diff --git a/.travis.yml b/.travis.yml index 8e808377b4..3ce9ea282d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/README.md b/README.md index bb6b633be3..9e6bd7d8ce 100644 --- a/README.md +++ b/README.md @@ -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]_ \ No newline at end of file diff --git a/scripts/release-community.sh b/scripts/release.sh old mode 100644 new mode 100755 similarity index 57% rename from scripts/release-community.sh rename to scripts/release.sh index 3627c63cf8..77ede07469 --- a/scripts/release-community.sh +++ b/scripts/release.sh @@ -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 diff --git a/scripts/set-release-variables.sh b/scripts/set-release-variables.sh index b61e123e56..c7da4594e1 100755 --- a/scripts/set-release-variables.sh +++ b/scripts/set-release-variables.sh @@ -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..." diff --git a/scripts/zip-artifacts.sh b/scripts/zip-artifacts.sh old mode 100644 new mode 100755 index 50154690a6..c182809d4e --- a/scripts/zip-artifacts.sh +++ b/scripts/zip-artifacts.sh @@ -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