-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
54 lines (53 loc) · 1.28 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
46
47
48
49
50
51
52
53
54
#!/usr/bin/env groovy
@Library('lib-aline')
def gv
pipeline {
agent any
environment {
def user = input.user.getDisplayName()
def time = new Date()
AWS_ACCESS_KEY_ID = credentials('LF_AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = credentials('LF_AWS_SECRET_ACCESS_KEY')
AWS_ID = credentials('AWS_ID')
AWS_REGION = credentials('LF_ALINE_AWS_REGION')
ALINE_TFVARS = credentials('LF_ALINE_TFVARS')
}
stages {
stage('tflint') {
steps {
script {
echo 'tflint'
tflint()
}
}
}
stage('tftest') {
when { branch pattern: "^(feature/).*", comparator: "REGEXP"}
steps {
script {
tftest()
}
}
}
stage('terraform plan') {
steps {
script {
tfplan()
}
}
}
stage('terraform apply') {
when { branch pattern: "^(main).*", comparator: "REGEXP"}
steps {
script {
tfapply()
}
}
}
}
post {
always {
cleanWs()
}
}
}