Repository: bahir Updated Branches: refs/heads/master 28f034f49 -> 415576ba7
[BAHIR-61] Enable publishing release artifacts from a tag Enable a --gitTag parameter to identify an RC tag to be used when publishing artifacts to maven. Project: http://git-wip-us.apache.org/repos/asf/bahir/repo Commit: http://git-wip-us.apache.org/repos/asf/bahir/commit/415576ba Tree: http://git-wip-us.apache.org/repos/asf/bahir/tree/415576ba Diff: http://git-wip-us.apache.org/repos/asf/bahir/diff/415576ba Branch: refs/heads/master Commit: 415576ba702206ba9cfc5c8bdbdee4869a1e52ac Parents: 28f034f Author: Luciano Resende <[email protected]> Authored: Wed Sep 28 12:41:35 2016 -0700 Committer: Luciano Resende <[email protected]> Committed: Wed Sep 28 12:41:35 2016 -0700 ---------------------------------------------------------------------- dev/release-build.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bahir/blob/415576ba/dev/release-build.sh ---------------------------------------------------------------------- diff --git a/dev/release-build.sh b/dev/release-build.sh index 0c39031..2575538 100755 --- a/dev/release-build.sh +++ b/dev/release-build.sh @@ -64,6 +64,7 @@ release-build.sh --release-prepare --releaseVersion="2.0.0" --developmentVersion release-build.sh --release-prepare --releaseVersion="2.0.0" --developmentVersion="2.1.0-SNAPSHOT" --releaseRc="rc1" --tag="v2.0.0" --gitCommitHash="a874b73" --dryRun release-build.sh --release-publish --gitCommitHash="a874b73" +release-build.sh --release-publish --gitTag="v2.0.0rc1" release-build.sh --release-snapshot release-build.sh --release-snapshot --gitCommitHash="a874b73" @@ -102,6 +103,10 @@ while [ "${1+defined}" ]; do GIT_REF="${PARTS[1]}" shift ;; + --gitTag) + GIT_TAG="${PARTS[1]}" + shift + ;; --releaseVersion) RELEASE_VERSION="${PARTS[1]}" shift @@ -155,9 +160,15 @@ if [[ "$RELEASE_PREPARE" == "true" && -z "$DEVELOPMENT_VERSION" ]]; then exit_with_usage fi -if [[ "$RELEASE_PUBLISH" == "true" && -z "$GIT_REF" ]]; then - echo "ERROR: --gitCommitHash must be passed as an argument to run this script" - exit_with_usage +if [[ "$RELEASE_PUBLISH" == "true" ]]; then + if [[ "$GIT_REF" && "$GIT_TAG" ]]; then + echo "ERROR: Only one argumented permitted when publishing : --gitCommitHash or --gitTag" + exit_with_usage + fi + if [[ -z "$GIT_REF" && -z "$GIT_TAG" ]]; then + echo "ERROR: --gitCommitHash OR --gitTag must be passed as an argument to run this script" + exit_with_usage + fi fi if [[ "$RELEASE_PUBLISH" == "true" && "$DRY_RUN" ]]; then @@ -172,6 +183,9 @@ fi # Commit ref to checkout when building GIT_REF=${GIT_REF:-master} +if [[ "$RELEASE_PUBLISH" == "true" && "$GIT_TAG" ]]; then + GIT_REF="tags/$GIT_TAG" +fi BASE_DIR=$(pwd)
