From e7b002cc96241fc995e1dc07bf744d656fe8dcc9 Mon Sep 17 00:00:00 2001 From: Tae Won Ha Date: Sat, 5 Nov 2016 08:53:11 +0100 Subject: [PATCH] GH-328 Add sanity check in build script and set develop as the default branch --- bin/build.sh | 26 ++++++++++++++++++++++++++ bin/build_vimr.sh | 1 + bin/clean_old_builds.sh | 1 + bin/commit_and_push_appcast.sh | 1 + bin/commit_and_push_tags.sh | 1 + bin/create_github_release.sh | 1 + bin/prepare_repositories.sh | 1 + bin/set_new_versions.sh | 1 + ci/create_build_snapshot_job.groovy | 3 +-- 9 files changed, 34 insertions(+), 2 deletions(-) diff --git a/bin/build.sh b/bin/build.sh index a8933f49..a50b01be 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -3,6 +3,7 @@ # For jenkins set -e +set -x # for utf-8 for python script export LC_CTYPE=en_US.UTF-8 @@ -15,6 +16,31 @@ export PATH=/usr/local/bin:$PATH # - RELEASE_NOTES # - UPDATE_APPCAST +if [ "${IS_SNAPSHOT}" = false ] && [ "${MARKETING_VERSION}" == "" ] ; then + echo "### ERROR If not snapshot, then the marketing version must be set!" + exit 1 +fi + +if [ "${RELEASE_NOTES}" == "" ] ; then + echo "### ERROR No release notes!" + exit 1 +fi + +if [ "${IS_SNAPSHOT}" = false ] && [ $"{UPDATE_APPCAST}" = false ] ; then + echo "### ERROR Not updating appcast for release!" + exit 1 +fi + +if [ "${IS_SNAPSHOT}" = false ] && [ $"{BRANCH}" != "master" ] ; then + echo "### ERROR Not building master for release!" + exit 1 +fi + +if [ "${IS_SNAPSHOT}" = true ] && [ $"{BRANCH}" == "master" ] ; then + echo "### ERROR Building master for snapshot!" + exit 1 +fi + echo "### Installing some python packages" pip install requests diff --git a/bin/build_vimr.sh b/bin/build_vimr.sh index 51aa6f33..4a7c8807 100755 --- a/bin/build_vimr.sh +++ b/bin/build_vimr.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x CODE_SIGN=$1 diff --git a/bin/clean_old_builds.sh b/bin/clean_old_builds.sh index fe5898b1..835eebb6 100755 --- a/bin/clean_old_builds.sh +++ b/bin/clean_old_builds.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x echo "### Cleaning old builds" diff --git a/bin/commit_and_push_appcast.sh b/bin/commit_and_push_appcast.sh index 8a1481b4..f6d3ee8a 100755 --- a/bin/commit_and_push_appcast.sh +++ b/bin/commit_and_push_appcast.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x BRANCH=$1 COMPOUND_VERSION=$2 diff --git a/bin/commit_and_push_tags.sh b/bin/commit_and_push_tags.sh index a10b3b47..7f061f98 100755 --- a/bin/commit_and_push_tags.sh +++ b/bin/commit_and_push_tags.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x BRANCH=$1 TAG=$2 diff --git a/bin/create_github_release.sh b/bin/create_github_release.sh index aebc10f0..4d3c0f6d 100755 --- a/bin/create_github_release.sh +++ b/bin/create_github_release.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x COMPOUND_VERSION=$1 TAG=$2 diff --git a/bin/prepare_repositories.sh b/bin/prepare_repositories.sh index 8311032b..9da606d9 100755 --- a/bin/prepare_repositories.sh +++ b/bin/prepare_repositories.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x echo "### Preparing repositories" diff --git a/bin/set_new_versions.sh b/bin/set_new_versions.sh index ebf10228..19f6c5b3 100755 --- a/bin/set_new_versions.sh +++ b/bin/set_new_versions.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x IS_SNAPSHOT=$1 MARKETING_VERSION=$2 diff --git a/ci/create_build_snapshot_job.groovy b/ci/create_build_snapshot_job.groovy index 1489d548..4e5d1b60 100644 --- a/ci/create_build_snapshot_job.groovy +++ b/ci/create_build_snapshot_job.groovy @@ -21,7 +21,7 @@ Builds a new snapshot of VimR and pushes the tag:
} parameters { - stringParam('BRANCH', 'master', 'Branch to build; defaults to master') + stringParam('BRANCH', 'develop', 'Branch to build; defaults to develop') textParam('RELEASE_NOTES', null, 'Release notes') booleanParam('IS_SNAPSHOT', true) booleanParam('UPDATE_APPCAST', true) @@ -38,7 +38,6 @@ Builds a new snapshot of VimR and pushes the tag:
} wrappers { - timestamps() colorizeOutput() }