forked from dcos-terraform/terraform-aws-instance
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
39 lines (38 loc) · 1.3 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
#!/usr/bin/env groovy
pipeline {
agent none
stages {
stage('Terraform FMT') {
agent { label 'terraform' }
steps {
sh 'terraform fmt --check --diff'
}
}
stage('Terraform validate') {
agent { label 'terraform' }
steps {
sh 'terraform init --upgrade'
sh 'terraform validate -check-variables=false'
}
}
stage('Validate README go generated') {
agent { label 'terraform' }
steps {
sh 'terraform-docs md ./ >README.md'
sh 'git --no-pager diff --exit-code'
}
}
stage('Validate variables.tf descriptions') {
agent { label "tfdescsan" }
steps {
sh 'tfdescsan --test --tsv https://dcos-terraform-mappings.mesosphere.com/ --var variables.tf --cloud "$(echo ${JOB_NAME##*/terraform-} | sed -E "s/(rm)?-.*//")"'
}
}
stage('Validate outputs.tf descriptions') {
agent { label "tfdescsan" }
steps {
sh 'tfdescsan --test --tsv https://dcos-terraform-mappings.mesosphere.com/ --var outputs.tf --cloud "$(echo ${JOB_NAME##*/terraform-} | sed -E "s/(rm)?-.*//")"'
}
}
}
}