test
This commit is contained in:
parent
970fd0cb11
commit
4227ca6965
1 changed files with 8 additions and 3 deletions
11
Jenkinsfile
vendored
11
Jenkinsfile
vendored
|
|
@ -22,11 +22,16 @@ pipeline {
|
||||||
|
|
||||||
sh 'git submodule update --init --recursive'
|
sh 'git submodule update --init --recursive'
|
||||||
|
|
||||||
if (env.BRANCH_NAME !== 'main') {
|
def branch = sh(
|
||||||
echo "[!] Not on main branch. Stopping pipeline."
|
script: "git rev-parse --abbrev-ref HEAD",
|
||||||
|
returnStdout: true
|
||||||
|
).trim()
|
||||||
|
|
||||||
|
if(branch != 'main') {
|
||||||
|
echo "[!] Not on 'main' branch. Current branch: ${branch}"
|
||||||
currentBuild.result = 'SUCCESS'
|
currentBuild.result = 'SUCCESS'
|
||||||
error("Stopping pipeline: not on main branch.")
|
error("Stopping pipeline: not on main branch.")
|
||||||
}
|
}
|
||||||
|
|
||||||
def tagName = sh(
|
def tagName = sh(
|
||||||
script: "git describe --tags --exact-match 2>/dev/null || echo 'no-tag'",
|
script: "git describe --tags --exact-match 2>/dev/null || echo 'no-tag'",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue