diff --git a/Jenkinsfile b/Jenkinsfile index ca77d5ab22..edd92bac41 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -93,7 +93,7 @@ pipeline { } stage("${OS} Bootstrap") { - sh "GIT_BRANCH=\$BRANCH_NAME ./deploy/build.sh --os=bootstrap" + sh "./deploy/build.sh --os=bootstrap --branch=${BRANCH_NAME}" if (OS.endsWith("armhf")) { sh "docker run --rm --privileged multiarch/qemu-user-static:register --reset" @@ -191,8 +191,12 @@ pipeline { OS -> [ "${OS} Release & Publish": { stage("${OS} Release & Publish") { ws("${WORKSPACE}/${OS}") { + stage("${OS} Bootstrap") { + sh "./deploy/build.sh --os=bootstrap --branch=${BRANCH_NAME} --version=${new_version}" + } + stage("${OS} Release") { - sh "./deploy/build.sh --os=${OS} --release=${new_version}" + sh "./deploy/build.sh --os=${OS} --release --branch=${BRANCH_NAME} --version=${new_version}" findFiles(glob: "packages/*.tgz").each { file -> release_file_list.add(WORKSPACE + "/" + file.path) @@ -204,7 +208,7 @@ pipeline { } stage("${OS} Publish") { - sh "./deploy/build.sh --os=${OS} --publish=${new_version} --keys=/mdsplus/certs --publishdir=/mdsplus/dist" + sh "./deploy/build.sh --os=${OS} --publish --branch=${BRANCH_NAME} --version=${new_version} --keys=/mdsplus/certs --publishdir=/mdsplus/dist" } } } @@ -214,7 +218,6 @@ pipeline { stage("Publish Version") { ws("${WORKSPACE}/publish") { def tag = "${BRANCH_NAME}_release-" + new_version.replaceAll("\\.", "-") - echo "Creating GitHub Release and Tag for ${tag}" withCredentials([ usernamePassword( diff --git a/deploy/build.sh b/deploy/build.sh index ffa3ce1414..fa78cef0b5 100755 --- a/deploy/build.sh +++ b/deploy/build.sh @@ -321,6 +321,9 @@ parsecmd() { eval "RELEASE_VERSION=${i#*=}" PUBLISH=yes ;; + --version=*) + eval "RELEASE_VERSION=${i#*=}" + ;; --platform=*) eval "PLATFORM=${i#*=}" ;; diff --git a/deploy/git_revision.sh b/deploy/git_revision.sh index 3d65018444..9becd0d4d3 100755 --- a/deploy/git_revision.sh +++ b/deploy/git_revision.sh @@ -2,9 +2,7 @@ SRC=$(realpath "$(dirname "$0")/..") GIT="git --git-dir=${SRC}/.git --work-tree=${SRC}" GIT_TAG="$(${GIT} describe --tag)" -if [ -z "${GIT_BRANCH}" ]; then - GIT_BRANCH="$(${GIT} rev-parse --abbrev-ref HEAD)" -fi +GIT_BRANCH="$(${GIT} rev-parse --abbrev-ref HEAD)" GIT_REMOTE="$(${GIT} config branch.${GIT_BRANCH}.remote)" GIT_REMOTE_URL="$(${GIT} config remote.${GIT_REMOTE}.url)" GIT_COMMIT="$(${GIT} rev-parse HEAD)"