keptn-terraform/jenkinsfile

50 lines
1.7 KiB
Plaintext

pipeline {
agent {
label 'terraform-slave'
}
environment {
TF_VAR_KEPTN_NAMESPACE="keptn"
TF_VAR_KEPTN_VERSION="1.4.0"
TF_VAR_KEPTN_DOMAIN="keptn.nttdata-xlabs.com"
TF_VAR_DT_TENANT="https://elw69065.live.dynatrace.com"
TF_VAR_DT_API_TOKEN="dt0c01.N2PBLK767N76X77W4DKPZBW3.RPIRL6HTSX6OOPFB4REGWBQEN62LYYVYYR3O5VAWGFW37OVXKB4G6ZQUHPL33LMP"
}
// parameters {
// booleanParam(name: 'refresh', defaultValue: false, description: 'Refresh pipeline properties')
// }
stages {
// stage('Refresh properties') {
// steps {
// script {
// if (Refresh) {
// currentBuild.result = 'ABORTED'
// error('Stopping early…')
// }
// }
// }
// }
stage('TF Plan') {
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 apply -auto-approve'
env.KEPTN_BRIDGE_URL = sh 'terraform output -raw Keptn_Bridge_Url'
}
}
}
}
}
}