REPO-4735 add release stage (#636)

Added the a Engineering Release stage and Company Release stage to travis.yml and added any required credentials to Travis.
Each release stage is triggered by a specific commit message, as listed in the "stages" section of travis.yml.
Provided a commit message to skip test stages if required, to speed up release process.
Global variables have been added to set the release version, development version and the community release version for the release stages.
This commit is contained in:
David Edwards
2020-03-16 11:29:36 +00:00
committed by GitHub
parent a988bcc58f
commit dc315393d4
9 changed files with 211 additions and 11 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ev
if [ -z ${COMM_RELEASE_VERSION} ] || [ -z ${RELEASE_VERSION} ];
then
echo "Please provide a COMM_RELEASE_VERSION and RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
exit -1
fi
build_number=$1
branch_name=$2
build_stage=release
SOURCE=s3://alfresco-artefacts-staging/alfresco-content-services-community/$build_stage/$branch_name/$build_number
DESTINATION=s3://eu.dl.alfresco.com/release/community/$COMM_RELEASE_VERSION-build-$build_number
aws s3 cp --acl private $SOURCE/alfresco.war $DESTINATION/alfresco.war
aws s3 cp --acl private $SOURCE/alfresco-content-services-community-distribution-$RELEASE_VERSION.zip $DESTINATION/alfresco-content-services-community-distribution-$RELEASE_VERSION.zip

30
scripts/travis/maven_release.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
releaseVersion=$1
developmentVersion=$2
scm_path=$(mvn help:evaluate -Dexpression=project.scm.url -q -DforceStdout)
# Use full history for release
git checkout -B "${TRAVIS_BRANCH}"
# Add email to link commits to user
git config user.email "${GIT_EMAIL}"
if [ -z ${releaseVersion} ] || [ -z ${developmentVersion} ];
then echo "Please provide a Release and Development verison in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
exit -1
else
mvn --batch-mode \
-Dusername="${GIT_USERNAME}" \
-Dpassword="${GIT_PASSWORD}" \
-DreleaseVersion=${releaseVersion} \
-DdevelopmentVersion=${developmentVersion} \
-Dbuild-number=${TRAVIS_BUILD_NUMBER} \
-Dbuild-name="${TRAVIS_BUILD_STAGE_NAME}" \
-Dscm-path=${scm_path} \
-DscmCommentPrefix="[maven-release-plugin][skip ci]" \
-DskipTests \
"-Darguments=-DskipTests -Dbuild-number=${TRAVIS_BUILD_NUMBER} '-Dbuild-name=${TRAVIS_BUILD_STAGE_NAME}' -Dscm-path=${scm_path} " \
release:clean release:prepare release:perform \
-Prelease
fi

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -e
if [ -v ${RELEASE_VERSION} ]||[ -z ${RELEASE_VERSION} ]; then
echo "Please provide a RELEASE_VERSION in the format <acs-version>-<additional-info> (6.3.0-EA or 6.3.0-SNAPSHOT)"
exit -1
fi
# get the image name from the pom file
alfresco_docker_image=$(mvn help:evaluate -f ./docker-alfresco/pom.xml -Dexpression=image.name -q -DforceStdout)
docker_image_full_name="$alfresco_docker_image:$RELEASE_VERSION"
function docker_image_exists() {
local image_full_name="$1"; shift
local wait_time="${1:-5}"
local search_term='Pulling|is up to date|not found'
echo "Looking to see if $image_full_name already exists..."
local result="$((timeout --preserve-status "$wait_time" docker 2>&1 pull "$image_full_name" &) | grep -v 'Pulling repository' | egrep -o "$search_term")"
test "$result" || { echo "Timed out too soon. Try using a wait_time greater than $wait_time..."; return 1 ;}
if echo $result | grep -vq 'not found'; then
true
else
false
fi
}
if docker_image_exists $docker_image_full_name; then
echo "Tag $RELEASE_VERSION already pushed, release process will interrupt."
exit -1
else
echo "The $RELEASE_VERSION tag was not found"
fi