From da43ea90bb752f72c347d232cbef22724902b4d1 Mon Sep 17 00:00:00 2001 From: ehardon Date: Wed, 14 Oct 2020 10:58:34 +0300 Subject: [PATCH] APPS-241: - combine community and enterprise publish stages into one --- .travis.yml | 38 +++++--------------------------- scripts/set-release-variables.sh | 2 ++ 2 files changed, 7 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index 89a181cb62..c7198c571c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -108,16 +108,15 @@ jobs: script: - echo "Static Analysis (SAST)" - - name: "Community Release" + - name: "Release" stage: Release and Publish - if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ ^\[.*community release.*\]$ + if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ ^\[.*release.*\]$ before_script: bash scripts/set-release-variables.sh script: - - echo "Community Release" - - bash scripts/release.sh community + - bash scripts/release.sh ${RELEASE_TYPE} before_deploy: - - bash scripts/zip-artifacts.sh community + - bash scripts/zip-artifacts.sh ${RELEASE_TYPE} deploy: - provider: s3 access_key_id: ${ARTIFACTS_KEY} @@ -131,31 +130,4 @@ jobs: on: all_branches: true after_deploy: - - echo "Finished release and deployed to https://s3.console.aws.amazon.com/s3/buckets/${ARTIFACTS_UPLOAD_BUCKET}/${ARTIFACTS_UPLOAD_DIR}" - - - - name: "Enterprise Release" - stage: Release and Publish - stage: Release - if: fork = false AND (branch = master OR branch =~ /release\/.*/) AND type != pull_request AND commit_message =~ /\[.*release .*\]/ - before_script: - bash scripts/set-release-variables.sh - script: - - echo "Enterprise Release" - - bash scripts/release.sh enterprise - before_deploy: - - bash scripts/zip-artifacts.sh enterprise - deploy: - - provider: s3 - access_key_id: ${ARTIFACTS_KEY} - secret_access_key: ${ARTIFACTS_SECRET} - region: "eu-west-1" - bucket: ${ARTIFACTS_UPLOAD_BUCKET} - upload_dir: ${ARTIFACTS_UPLOAD_DIR} - skip_cleanup: true - acl: private - local_dir: artifacts_dir - on: - all_branches: true - after_deploy: - - echo "Finished release and deployed to https://s3.console.aws.amazon.com/s3/buckets/${ARTIFACTS_UPLOAD_BUCKET}/${ARTIFACTS_UPLOAD_DIR}" + - echo "Finished release and deployed to https://s3.console.aws.amazon.com/s3/buckets/${ARTIFACTS_UPLOAD_BUCKET}/${ARTIFACTS_UPLOAD_DIR}" \ No newline at end of file diff --git a/scripts/set-release-variables.sh b/scripts/set-release-variables.sh index c7da4594e1..56dfbb680e 100755 --- a/scripts/set-release-variables.sh +++ b/scripts/set-release-variables.sh @@ -17,6 +17,7 @@ release_type=$(echo $release_message | grep -Po '(internal\s)*(community|enterpr if [[ $release_type =~ "community" ]]; then echo "Setting Community Release variables..." + export RELEASE_TYPE="community" if [[ $release_type =~ "internal" ]]; then echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release" export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging" @@ -28,6 +29,7 @@ if [[ $release_type =~ "community" ]]; then fi elif [[ $release_type =~ "enterprise" ]]; then echo "Setting Enterprise Release variables..." + export RELEASE_TYPE="enterprise" if [[ $release_type =~ "internal" ]]; then echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release" export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging"