-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
45 lines (41 loc) · 1.03 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
40
41
42
43
44
45
pipeline {
environment {
AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_KEY')
}
pipeline {
agent any
stages {
stage ("checkout from GIT") {
steps {
git branch: 'main', url: 'https://github.com/rahuls512/AWS-CICD-with-Jenkins-Terraform-Webhook-GroovyScripts.git'
}
}
stage ("terraform init") {
steps {
sh 'terraform init'
}
}
stage ("terraform fmt") {
steps {
sh 'terraform fmt'
}
}
stage ("terraform validate") {
steps {
sh 'terraform validate'
}
}
stage ("terrafrom plan") {
steps {
sh 'terraform plan '
}
}
stage ("terraform apply") {
steps {
sh 'terraform apply --auto-approve'
}
}
}
}
}