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 60a656d3b8
commit 5b71f2ec05
5 changed files with 20 additions and 25 deletions

View File

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

View File

@@ -139,19 +139,3 @@ solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
``` ```
Start your repository 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.email "${GIT_COMMITTER_EMAIL}"
git config user.name "${GIT_COMMITTER_NAME}" 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} ]; if [ -z ${RELEASE_VERSION} ] || [ -z ${DEVELOPMENT_VERSION} ];
then echo "Please provide a Release and Development verison" then echo "Please provide a Release and Development verison"
exit -1 exit 1
else else
mvn --batch-mode mvn --batch-mode
-Dusername="${GITHUB_USERNAME}" \ -Dusername="${GITHUB_USERNAME}" \
-Dpassword="${GITHUB_PASSWORD}" \ -Dpassword="${GITHUB_PASSWORD}" \
-DreleaseVersion=${RELEASE_VERSION} \ -DreleaseVersion=${RELEASE_VERSION} \
-DdevelopmentVersion=${DEVELOPMENT_VERSION} \ -DdevelopmentVersion=${DEVELOPMENT_VERSION} \
-DskipTests -Dcommunity -DuseReleaseProfile=false \ -DskipTests -D${release_type} -DuseReleaseProfile=false \
-Prelease-community release:clean release:prepare release:perform -Prelease-${release_type} release:clean release:prepare release:perform
fi fi

View File

@@ -1,19 +1,19 @@
#!/usr/bin/env bash #!/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 if [ ! -n "$release_message" ]; then
echo "The commit message is in the wrong format or it does not contain all the required properties." echo "The commit message is in the wrong format or it does not contain all the required properties."
exit 0 exit 1
fi fi
export RELEASE_VERSION=$(echo $release_message | ggrep -Po '\g<1>(\d\.)+(\d|[a-z])(-[A-Z]\d){0,1}') 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 | ggrep -Po '(\d\.)+\d-SNAPSHOT') export DEVELOPMENT_VERSION=$(echo $release_message | grep -Po '(\d\.)+\d-SNAPSHOT')
echo "Release version is set to $RELEASE_VERSION" echo "Release version is set to $RELEASE_VERSION"
echo "Development version is set to $DEVELOPMENT_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 if [[ $release_type =~ "community" ]]; then
echo "Setting Community Release variables..." 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" mkdir "artifacts_dir"
cp rm-community/rm-community-repo/target/alfresco-rm-*community*amp 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-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 cd artifacts_dir
zip alfresco-rm-community-${RELEASE_VERSION}.zip *amp zip alfresco-rm-community-${RELEASE_VERSION}.zip *amp
ls artifacts_dir ls artifacts_dir