APPS-241: - address PR comments

- extract release version and development version from commit message
This commit is contained in:
ehardon
2020-10-07 16:02:26 +03:00
parent 17d00af5e2
commit 592b680441
6 changed files with 32 additions and 23 deletions

View File

@@ -27,10 +27,6 @@ install: skip
services:
- docker
env:
global:
- RELEASE_VERSION=2.7.3
- DEVELOPMENT_VERSION=2.7.3-SNAPSHOT
stages:
- name: Build AGS

View File

@@ -138,3 +138,12 @@ Unzip it and change to the "solr" folder within it. Start the Solr server using
solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
```
Start your repository
## Release process
In order to release a new community or enterprise version you need to:
* make sure you are either on a release branch or on master branch
* push a new commit message containing the following [$release_type release $release_version $development_version] where
* release_type should contain one of the following: *internal community*/*internal enterprise* -> for internal releases or _community_/_enterprise_
* release_version must contain the desired release version
* development_version must contain the next development version

View File

@@ -1,16 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
GIT_COMMITTER_NAME=alfresco-build
GIT_COMMITTER_EMAIL=info@alfresco.com
# Use full history for release
git checkout -B "${TRAVIS_BRANCH}"
# Add email to link commits to user
git config user.email "${GIT_COMMITTER_EMAIL}"
git config user.name "${GIT_COMMITTER_NAME}"
if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ];
then echo "Please provide a Release and Development verison"
exit -1

View File

@@ -1,34 +1,40 @@
#!/bin/bash
set -e
#!/usr/bin/env bash
# TODO: check if the message is in the right format eg [internal community release 3.4.0 3.4.0-SNAPSHOT]
release_message=$(echo $TRAVIS_COMMIT_MESSAGE | ggrep -Po '\[(internal )*(community|enterprise)\srelease\s(\d\.)+(\d|[a-z])\s(\d\.)+\d-SNAPSHOT\]')
if [ ! -n "$release_message" ]; then
echo "The commit message is in the wrong format or it does not contain all the required properties."
exit 0
fi
export RELEASE_VERSION=$(echo $TRAVIS_COMMIT_MESSAGE | grep -Po '(\d\.)+\d ')
export DEVELOPMENT_VERSION=$(echo $TRAVIS_COMMIT_MESSAGE | grep -Po '(\d\.)+\d-SNAPSHOT')
export RELEASE_VERSION=$(echo $release_message | ggrep -Po '\g<1>(\d\.)+(\d|[a-z])')
export DEVELOPMENT_VERSION=$(echo $release_message | ggrep -Po '(\d\.)+\d-SNAPSHOT')
export release_type=$(echo $TRAVIS_COMMIT_MESSAGE | grep -Po 'internal (community|enterprise)')
echo "Release version is set to $RELEASE_VERSION"
echo "Development version is set to $DEVELOPMENT_VERSION"
release_type=$(echo $release_message | ggrep -Po '(internal\s)*(community|enterprise)')
if [[ $release_type =~ "community" ]]; then
echo "Setting Community release variables..."
echo "Setting Community Release variables..."
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"
export ARTIFACTS_UPLOAD_DIR="community/alfresco-governance-services/release/${TRAVIS_BRANCH}"
else
echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the release"
# export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging" ->
# export ARTIFACTS_UPLOAD_DIR="community/alfresco-governance-services/release/${TRAVIS_BRANCH}"
export ARTIFACTS_UPLOAD_BUCKET="eu.dl.alfresco.com"
export ARTIFACTS_UPLOAD_DIR="release/community/RM/${RELEASE_VERSION}"
fi
elif [[ $release_type =~ "enterprise" ]]; then
echo "Setting Enterprise release variables..."
echo "Setting Enterprise Release variables..."
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"
export ARTIFACTS_UPLOAD_DIR="enterprise/alfresco-governance-services/release/${TRAVIS_BRANCH}"
else
echo "Setting ARTIFACTS_UPLOAD_BUCKET and ARTIFACTS_UPLOAD_DIR for the release"
# export ARTIFACTS_UPLOAD_BUCKET="alfresco-artefacts-staging" ->
# export ARTIFACTS_UPLOAD_DIR="enterprise/alfresco-governance-services/release/${TRAVIS_BRANCH}"
export ARTIFACTS_UPLOAD_BUCKET="eu.dl.alfresco.com"
export ARTIFACTS_UPLOAD_DIR="release/enterprise/RM/${RELEASE_VERSION}"
fi
fi

View File

@@ -1,12 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
set -e
if [ $1 == 'community' ]; then
mkdir "artifacts_dir"
cp rm-community/rm-community-repo/target/alfresco-rm-*community*amp artifacts_dir
cp rm-community/rm-community-share/target/alfresco-rm-*community*amp artifacts_dir
cd artifacts_dir
zip alfresco-rm-community-${RELEASE_VERSION}.zip *amp
cp alfresco-rm-community-${RELEASE_VERSION}.zip artifacts_dir
ls artifacts_dir
#elif [ $1 == "enterprise" ]; then
fi

View File

@@ -4,3 +4,5 @@ env:
- AUTOMATION_ENTERPRISE_PATH=rm-automation/rm-automation-enterprise-rest-api
- AUTOMATION_UI_PATH=rm-automation/rm-automation-ui
- S3_INSTALLER_PATH=/eu.dl.alfresco.com/release/enterprise/5.2/5.2.7/5.2.7.4/alfresco-content-services-installer-5.2.7.4-linux-x64.bin
- GIT_COMMITTER_NAME=alfresco-build
- GIT_COMMITTER_EMAIL=info@alfresco.com