mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
APPS-241: - address PR comments
- extract release version and development version from commit message
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user