-
Notifications
You must be signed in to change notification settings - Fork 11
/
Taskfile.yml
78 lines (65 loc) · 1.75 KB
/
Taskfile.yml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: '2'
env:
TERM: screen-256color
GO111MODULE: on
AWS_DEFAULT_REGION: eu-west-1
tasks:
default:
cmds:
- task: test
test:
desc: Run tests.
cmds:
- task: test-go
- task: test-terraform
test-go:
desc: Run tests for all Go code.
silent: true
cmds:
- gofmt -s -l -w .
- go vet -v ./...
test-terraform:
desc: Run tests for all terraform directories.
silent: true
env:
DIRECTORIES:
sh: find . -type f -name '*.tf' -not -path "**/.terraform/*" -print0 | xargs -0I {} dirname {} | sort -u
cmds:
- |
BOLD=$(tput bold)
NORM=$(tput sgr0)
CWD=$PWD
for d in $DIRECTORIES; do
cd $d
echo "${BOLD}$PWD:${NORM}"
if ! terraform fmt -check=true -list=false -recursive=true; then
echo " ✗ terraform fmt" && exit 1
else
echo " √ terraform fmt"
fi
if ! terraform init -backend=false -input=false -get=true -get-plugins=true -no-color > /dev/null; then
echo " ✗ terraform init" && exit 1
else
echo " √ terraform init"
fi
if ! terraform validate > /dev/null; then
echo " ✗ terraform validate" && exit 1
else
echo " √ terraform validate"
fi
cd $CWD
done
e2e:
desc: Run the end 2 end test suite.
silent: true
cmds:
- go test -v ./... -timeout=1h
ami:
desc: Build the packer template to create a Concourse AMI.
silent: true
cmds:
- packer validate -var="template_version={{.VERSION}}" packer/template.json
- packer build -var="template_version={{.VERSION}}" packer/template.json
vars:
VERSION:
sh: git describe --tags --candidates=1 --dirty