add a check for already existing release tag
also run cleanup in post-always Jenkinsfile block Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
9de77b21b2
commit
5f763439cb
8
Makefile
8
Makefile
|
@ -184,7 +184,13 @@ prepare-release: clean-release
|
|||
clean-release:
|
||||
rm -rf $(RELEASE_DIR)
|
||||
|
||||
release:
|
||||
check-existing-release:
|
||||
@git ls-remote --exit-code origin "v$(RELEASE_TAG)" >/dev/null && \
|
||||
echo "$(YELLOW)Release tag already exists: v$(RELEASE_TAG)$(RESET)"; \
|
||||
echo "Remove the tag/release if you want to re-create it."; \
|
||||
exit 1
|
||||
|
||||
release: check-existing-release
|
||||
@read -p "Are you sure you want to create a new GitHub $(RELEASE_TYPE) against $(RELEASE_BRANCH) branch? (y/n): " REPLY; \
|
||||
if [ $$REPLY = "y" ]; then \
|
||||
latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1`); \
|
||||
|
|
|
@ -108,9 +108,11 @@ pipeline {
|
|||
}
|
||||
} }
|
||||
} // stage(Release)
|
||||
|
||||
stage('Cleanup') { steps { dir(env.STATUS_PATH) {
|
||||
sh 'make clean-release'
|
||||
} } } // stage(Cleanup)
|
||||
} // stages
|
||||
|
||||
post {
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean-release'
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,14 +69,13 @@ pipeline {
|
|||
stage('Upload') { steps { script {
|
||||
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
|
||||
} } }
|
||||
|
||||
stage('Cleanup') { steps { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} } }
|
||||
} // stages
|
||||
post {
|
||||
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
||||
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} }
|
||||
} // post
|
||||
} // pipeline
|
||||
|
|
|
@ -68,8 +68,10 @@ pipeline {
|
|||
} } } }
|
||||
} // stages
|
||||
post {
|
||||
always { dir(env.STATUS_PATH) { sh 'make clean-docker-images' } }
|
||||
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
||||
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean-docker-images'
|
||||
} }
|
||||
} // post
|
||||
} // pipeline
|
||||
|
|
|
@ -67,14 +67,13 @@ pipeline {
|
|||
stage('Upload') { steps { script {
|
||||
env.PKG_URL = lib.uploadArtifact("pkg/${artifact}")
|
||||
} } }
|
||||
|
||||
stage('Cleanup') { steps { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} } }
|
||||
} // stages
|
||||
post {
|
||||
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
||||
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} }
|
||||
} // post
|
||||
} // pipeline
|
||||
|
|
|
@ -67,5 +67,9 @@ pipeline {
|
|||
post {
|
||||
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
||||
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} }
|
||||
} // post
|
||||
} // pipeline
|
||||
|
|
|
@ -74,5 +74,9 @@ pipeline {
|
|||
post {
|
||||
success { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(true) } }
|
||||
failure { script { load("${CI_DIR}/ghcmgr.groovy").postBuild(false) } }
|
||||
always { dir(env.STATUS_PATH) {
|
||||
sh 'make clean'
|
||||
sh "rm -fr ${dest}"
|
||||
} }
|
||||
} // post
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue