-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
39 lines (38 loc) · 1.06 KB
/
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
32
33
34
35
36
37
38
39
pipeline {
agent any
environment {
TF_IN_AUTOMATION = 'true'
TF_CLI_CONFIG_FILE = credentials('tf-cloud')
AWS_ACCESS_KEY_ID = credentials('jenkins-aws-secret-key-id')
AWS_SECRET_ACCESS_KEY = credentials('jenkins-aws-secret-access-key')
TF_VAR_my_aws_pem = '/var/lib/jenkins/MyAWSKey.pem'
TF_VAR_my_jenkins_pem = '/var/lib/jenkins/MyAWSKey.pem'
TF_VAR_my_aws_pub = credentials('my-aws-pub')
}
stages {
stage('Init') {
steps {
sh 'terraform init -no-color'
}
}
stage('Plan') {
steps {
sh 'terraform plan -no-color'
}
}
stage('Apply Confirm') {
input {
message "Apply Confirmation"
ok "Apply changes"
}
steps {
echo 'Apply proceeding...'
}
}
stage('Apply') {
steps {
sh 'terraform apply -auto-approve -no-color'
}
}
}
}