Commit bf348689629d96dd151994c071a4b1704536f7b6

Authored by Jacob Vosmaer
1 parent fce242c0

Upload EE release packages to random directory

Showing 1 changed file with 11 additions and 1 deletions   Show diff stats
@@ -34,12 +34,22 @@ if [[ -z ${release_package} ]]; then @@ -34,12 +34,22 @@ if [[ -z ${release_package} ]]; then
34 error_exit 'could not find the release package' 34 error_exit 'could not find the release package'
35 fi 35 fi
36 36
  37 +if (git describe | grep -w ee); then
  38 + release_dir="$(openssl rand -hex 20)"
  39 + if [[ $? -ne 0 ]]; then
  40 + error_exit 'failed to generate release directory name'
  41 + fi
  42 + remote_package_path="s3://${RELEASE_BUCKET}/${release_dir}/${release_package}"
  43 +else
  44 + remote_package_path="s3://${RELEASE_BUCKET}/${release_package}"
  45 +fi
  46 +
37 echo 47 echo
38 echo 'Package MD5:' 48 echo 'Package MD5:'
39 md5sum ${release_package} 49 md5sum ${release_package}
40 50
41 echo 51 echo
42 echo 'Starting upload' 52 echo 'Starting upload'
43 -if !(aws s3 cp ${release_package} s3://${RELEASE_BUCKET} --acl public-read --region ${RELEASE_BUCKET_REGION}); then 53 +if !(aws s3 cp ${release_package} ${remote_package_path} --acl public-read --region ${RELEASE_BUCKET_REGION}); then
44 error_exit 'release upload failed' 54 error_exit 'release upload failed'
45 fi 55 fi