plaground-sandbox/Jenkinsfile

22 lines
565 B
Plaintext
Raw Permalink Normal View History

2022-08-14 12:25:47 +02:00
pipeline {
agent any
stages {
stage('TEST') {
steps {
2022-08-14 12:34:35 +02:00
script {
2022-08-14 12:35:45 +02:00
CUSTOM_TAG = sh(returnStdout: true, script: "git tag --contains").trim()
2022-08-14 12:36:55 +02:00
echo CUSTOM_TAG
2022-08-14 12:34:35 +02:00
}
2022-08-14 12:27:22 +02:00
echo sh(script: 'env|sort', returnStdout: true)
2022-08-14 12:35:45 +02:00
echo "${CUSTOM_TAG}"
2022-08-14 12:25:47 +02:00
}
}
2022-08-14 12:54:29 +02:00
stage('ONLY ON TAG') {
when { buildingTag() }
steps {
echo "I run only because I am on tag ${CUSTOM_TAG}"
}
}
2022-08-14 12:25:47 +02:00
}
}