-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
31 lines (31 loc) · 841 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
pipeline {
agent {
node {
label 'c7vfc'
}
}
environment {
terraform_varsfile = 'testing.tfvars'
}
stages {
stage('Init Terraform') {
steps {
withCredentials([string(credentialsId: 'TF_VAR_secret_key', variable: 'TF_VAR_secret_key'), string(credentialsId: 'TF_VAR_access_key', variable: 'TF_VAR_access_key')]) {
sh 'terraform init'
}
}
}
stage('Validate Terraform') {
steps {
withCredentials([string(credentialsId: 'TF_VAR_secret_key', variable: 'TF_VAR_secret_key'), string(credentialsId: 'TF_VAR_access_key', variable: 'TF_VAR_access_key')]) {
sh 'terraform validate'
}
}
}
}
post {
always {
cleanWs(deleteDirs: true)
}
}
}