-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (40 loc) · 1.06 KB
/
Makefile
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
SHELL=/bin/bash
TF_VERSION := 1.10.1
# Before running this test, you must:
# export GITHUB_TOKEN=your-token
# export GITHUB_USER=your-username
export TF_VAR_flux_git_user := ${GITHUB_USER}
export TF_VAR_flux_git_token := ${GITHUB_TOKEN}
.PHONY: test
test: test-all
.PHONY: test-blue
test-blue:
go test -v -run TestE2E -timeout 120m0s -scope blue -tf-version ${TF_VERSION}
.PHONY: test-green
test-green:
go test -v -run TestE2E -timeout 120m0s -scope green -tf-version ${TF_VERSION}
.PHONY: test-all
test-all:
go test -v -run TestE2E -timeout 120m0s -scope all -tf-version ${TF_VERSION}
define CLEAN
pushd ../fixtures/${1} \
&& terraform destroy -var-file=e2e.tfvars -auto-approve -no-color \
&& popd
pushd ../fixtures/${1} \
&& rm -f terraform.tfstate \
&& rm -f terraform.tfstate.backup \
&& popd
endef
.PHONY: clean
clean: clean-all
.PHONY: clean-all
clean-all: clean-blue clean-green clean-shared
.PHONY: clean-shared
clean-shared:
$(call CLEAN,shared)
.PHONY: clean-blue
clean-blue:
$(call CLEAN,blue)
.PHONY: clean-green
clean-green:
$(call CLEAN,green)