fix pippeline
parent
efc569e47f
commit
b3942f6a47
|
|
@ -12,18 +12,6 @@ pipeline {
|
|||
}
|
||||
}
|
||||
|
||||
parameters {
|
||||
|
||||
gitParam('BRANCH_TAG') {
|
||||
description('Git tag or branch to use for this Terraform build')
|
||||
type('BRANCH_TAG')
|
||||
sortMode('ASCENDING')
|
||||
defaultValue('origin/master')
|
||||
tagFilter('*')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
environment {
|
||||
GIT_SSH_COMMAND = "ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||
|
||||
|
|
@ -49,27 +37,6 @@ pipeline {
|
|||
|
||||
stages {
|
||||
|
||||
stage("check branch/tag") {
|
||||
steps {
|
||||
sshagent(credentials: ['sofa-user-automation']) {
|
||||
script {
|
||||
env.PLAN_STATUS = sh(script: """
|
||||
| if [[ "\$(git ls-remote origin 2>/dev/null | grep 'refs/tags/$tag\$')" ]]; then
|
||||
| echo "Release $tag exists"
|
||||
| exit 1
|
||||
| fi
|
||||
""".stripMargin('| '), returnStatus: true)
|
||||
|
||||
if (env.PLAN_STATUS == "1") {
|
||||
currentBuild.result = "FAILURE"
|
||||
error('Aborting the build.')
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('terraform init') {
|
||||
steps {
|
||||
container('terraform') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue