APPS-241: - combine community and enterprise publish stages into one

This commit is contained in:
ehardon
2020-10-14 10:58:34 +03:00
parent f46976a687
commit da43ea90bb
2 changed files with 7 additions and 33 deletions

View File

@@ -108,16 +108,15 @@ jobs:
script: script:
- echo "Static Analysis (SAST)" - echo "Static Analysis (SAST)"
- name: "Community Release" - name: "Release"
stage: Release and Publish 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: before_script:
bash scripts/set-release-variables.sh bash scripts/set-release-variables.sh
script: script:
- echo "Community Release" - bash scripts/release.sh ${RELEASE_TYPE}
- bash scripts/release.sh community
before_deploy: before_deploy:
- bash scripts/zip-artifacts.sh community - bash scripts/zip-artifacts.sh ${RELEASE_TYPE}
deploy: deploy:
- provider: s3 - provider: s3
access_key_id: ${ARTIFACTS_KEY} access_key_id: ${ARTIFACTS_KEY}
@@ -131,31 +130,4 @@ jobs:
on: on:
all_branches: true all_branches: true
after_deploy: 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}"
- 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}"

View File

@@ -17,6 +17,7 @@ release_type=$(echo $release_message | grep -Po '(internal\s)*(community|enterpr
if [[ $release_type =~ "community" ]]; then if [[ $release_type =~ "community" ]]; then
echo "Setting Community Release variables..." echo "Setting Community Release variables..."
export RELEASE_TYPE="community"
if [[ $release_type =~ "internal" ]]; then if [[ $release_type =~ "internal" ]]; then
echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release" echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release"
export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging" export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging"
@@ -28,6 +29,7 @@ if [[ $release_type =~ "community" ]]; then
fi fi
elif [[ $release_type =~ "enterprise" ]]; then elif [[ $release_type =~ "enterprise" ]]; then
echo "Setting Enterprise Release variables..." echo "Setting Enterprise Release variables..."
export RELEASE_TYPE="enterprise"
if [[ $release_type =~ "internal" ]]; then if [[ $release_type =~ "internal" ]]; then
echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release" echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the Internal release"
export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging" export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging"