keptn destroy to jenkins file
parent
057fe4c676
commit
abe599f95c
33
jenkinsfile
33
jenkinsfile
|
|
@ -11,6 +11,10 @@ pipeline {
|
|||
TF_VAR_DT_API_TOKEN="dt0c01.N2PBLK767N76X77W4DKPZBW3.RPIRL6HTSX6OOPFB4REGWBQEN62LYYVYYR3O5VAWGFW37OVXKB4G6ZQUHPL33LMP"
|
||||
}
|
||||
|
||||
parameters {
|
||||
choice(name: 'mode', choices: ['apply', 'destroy'], description: '', defaultValue: 'apply')
|
||||
}
|
||||
|
||||
// parameters {
|
||||
// booleanParam(name: 'refresh', defaultValue: false, description: 'Refresh pipeline properties')
|
||||
// }
|
||||
|
|
@ -26,7 +30,12 @@ pipeline {
|
|||
// }
|
||||
// }
|
||||
// }
|
||||
stage('TF Plan') {
|
||||
stage('Deploy Keptn') {
|
||||
when {
|
||||
expression {
|
||||
return params.mode == 'apply'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
container('terraform') {
|
||||
withCredentials([[
|
||||
|
|
@ -49,6 +58,28 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
stage('Destroy Keptn') {
|
||||
when {
|
||||
expression {
|
||||
return params.mode == 'destroy'
|
||||
}
|
||||
}
|
||||
steps {
|
||||
container('terraform') {
|
||||
withCredentials([[
|
||||
$class: 'AmazonWebServicesCredentialsBinding',
|
||||
credentialsId: "f89b3f7d-23ec-42b9-9687-e4acf01d7507",
|
||||
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
|
||||
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
|
||||
sh 'chmod -R 777 ./terraform-kubernetes-get-secret/bin'
|
||||
sh 'terraform version'
|
||||
sh 'terraform init -backend-config="key=keptn-demo"'
|
||||
sh 'terraform destroy -auto-approve'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ set {
|
|||
|
||||
set {
|
||||
name = "remoteControlPlane.topicSubscription"
|
||||
value = "sh.keptn.event.deployment.triggered\\,sh.keptn.event.test.triggered\\,sh.keptn.event.action.triggered"
|
||||
value = "sh.keptn.event.deployment.triggered\\,sh.keptn.event.test.triggered\\,sh.keptn.event.action.triggered\\,sh.keptn.event.uninstall.triggered"
|
||||
}
|
||||
|
||||
depends_on = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue