APPS-241: - remove release documentation

- update regex to get only the first match of the release version
- update release script to be used in enterprise release as well
This commit is contained in:
ehardon
2020-10-09 09:54:23 +03:00
parent 4a3cf69805
commit 7277b2adf0
5 changed files with 20 additions and 25 deletions

View File

@@ -116,7 +116,7 @@ jobs:
bash scripts/set-release-variables.sh
script:
- echo "Community Release"
- bash scripts/release-community.sh
- bash scripts/release.sh community
before_deploy:
- bash scripts/zip-artifacts.sh community
deploy:

View File

@@ -138,20 +138,4 @@ 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 use either a release branch or the master branch
* the branch involved in the release should not be forked and should not have an open PR
* push a new commit message containing the following pattern [$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
Release commit message examples:
* internal enterprise version:
_[internal enterprise release 3.4.a-A1 3.5.0-SNAPSHOT]_
* community version:
_[community release 3.4.a 3.5.0-SNAPSHOT]_

16
scripts/release-community.sh → scripts/release.sh Normal file → Executable file
View File

@@ -7,15 +7,25 @@ git checkout -B "${TRAVIS_BRANCH}"
git config user.email "${GIT_COMMITTER_EMAIL}"
git config user.name "${GIT_COMMITTER_NAME}"
release_type=$1
if [ -z $release_type ]; then
echo "Please provide a release type."
exit 1
elif [ $release_type != "community" -a $release_type != "enterprise" ]; then
echo "The provided release type is not valid."
exit 1
fi
if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ];
then echo "Please provide a Release and Development verison"
exit -1
exit 1
else
mvn --batch-mode
-Dusername="${GITHUB_USERNAME}" \
-Dpassword="${GITHUB_PASSWORD}" \
-DreleaseVersion=${RELEASE_VERSION} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION} \
-DskipTests -Dcommunity -DuseReleaseProfile=false \
-Prelease-community release:clean release:prepare release:perform
-DskipTests -D${release_type} -DuseReleaseProfile=false \
-Prelease-${release_type} release:clean release:prepare release:perform
fi

View File

@@ -1,19 +1,19 @@
#!/usr/bin/env bash
release_message=$(echo $TRAVIS_COMMIT_MESSAGE | ggrep -Po '\[(internal )*(community|enterprise)\srelease\s(\d\.)+(\d|[a-z])\s(\d\.)+\d-SNAPSHOT\]')
release_message=$(echo $TRAVIS_COMMIT_MESSAGE | grep -Po '\[(internal )*(community|enterprise)\srelease\s(\d\.)+(\d|[a-z])(-[A-Z]\d){0,1}\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
exit 1
fi
export RELEASE_VERSION=$(echo $release_message | ggrep -Po '\g<1>(\d\.)+(\d|[a-z])(-[A-Z]\d){0,1}')
export DEVELOPMENT_VERSION=$(echo $release_message | ggrep -Po '(\d\.)+\d-SNAPSHOT')
export RELEASE_VERSION=$(echo $release_message | grep -Po '(\d\.)+(\d|[a-z])(-[A-Z]\d){0,1}' | head -1)
export DEVELOPMENT_VERSION=$(echo $release_message | grep -Po '(\d\.)+\d-SNAPSHOT')
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)')
release_type=$(echo $release_message | grep -Po '(internal\s)*(community|enterprise)')
if [[ $release_type =~ "community" ]]; then
echo "Setting Community Release variables..."

1
scripts/zip-artifacts.sh Normal file → Executable file
View File

@@ -5,6 +5,7 @@ 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
cp rm-community/rm-community-rest-api-explorer/target/alfresco-rm-*community*war artifacts_dir
cd artifacts_dir
zip alfresco-rm-community-${RELEASE_VERSION}.zip *amp
ls artifacts_dir