2020-03-02 22:35:26 +03:00
|
|
|
stage ('predeploy') {
|
2020-03-02 22:47:41 +03:00
|
|
|
echo 'checking tag'
|
|
|
|
script {
|
2020-03-04 19:41:58 +03:00
|
|
|
def tag = sh(returnStdout: true, script: "git tag --contains").trim()
|
|
|
|
|
|
|
|
if (tag) {
|
2020-03-02 22:47:41 +03:00
|
|
|
echo 'found tag ' + tag
|
2020-03-04 19:41:58 +03:00
|
|
|
def tagNoV = tag.substring(1)
|
|
|
|
sh "cd ${TARGET_FOLDER} ; echo 'mkdir ${tagNoV}; mv ./master/* ./${tagNoV}; rm -r -d ./master; rm ${DEPLOY_VERSION_SH}' > ${DEPLOY_VERSION_SH}"
|
2020-03-02 22:47:41 +03:00
|
|
|
} else {
|
|
|
|
echo 'tag not found'
|
2020-03-04 19:41:58 +03:00
|
|
|
sh "cd ${TARGET_FOLDER} ; echo 'rm ${DEPLOY_VERSION_SH}' > ${DEPLOY_VERSION_SH}"
|
2020-03-02 22:35:26 +03:00
|
|
|
}
|
|
|
|
}
|
2020-03-02 22:47:41 +03:00
|
|
|
}
|
2020-03-02 22:35:26 +03:00
|
|
|
|
2020-03-02 22:47:41 +03:00
|
|
|
stage ('archiving') {
|
|
|
|
// Archive the build output artifacts.
|
2020-03-04 19:41:58 +03:00
|
|
|
script {
|
|
|
|
archiveArtifacts artifacts: "${TARGET_FOLDER}/*"
|
|
|
|
}
|
2020-03-02 22:35:26 +03:00
|
|
|
}
|