-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
Makefile
89 lines (75 loc) · 2.1 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/usr/bin/env make
.PHONY: all
all: lint test
# Install Python first
.PHONY: install
install:
poetry install --no-root
poetry run pre-commit install --install-hooks
poetry run ansible-galaxy collection install -r requirements.yml
.PHONY: clean
clean:
poetry env remove
.PHONY: update
update:
poetry update
poetry run pre-commit autoupdate
.PHONY: lint
lint:
poetry run ansible-lint --profile=production
.PHONY: test
test: test-default test-absent
# If local, make sure TAILSCALE_CI_KEY env var is set.
# This is automatically populated in a GitHub Codespace.
.PHONY: test-all
test-all:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --all
endif
.PHONY: test-default
test-default:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name default
endif
.PHONY: test-idempotent-up
test-idempotent-up:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name idempotent-up
endif
.PHONY: test-args
test-args:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name args
endif
.PHONY: test-absent
test-absent:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name state-absent
endif
.PHONY: test-oauth
test-oauth:
ifndef TAILSCALE_OAUTH_CLIENT_SECRET
$(error TAILSCALE_OAUTH_CLIENT_SECRET is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name oauth
endif
.PHONY: test-strategy-free
test-strategy-free:
ifndef TAILSCALE_CI_KEY
$(error TAILSCALE_CI_KEY is not set)
else
HEADSCALE_IMAGE=headscale/headscale:0.22 poetry run molecule test --scenario-name strategy-free
endif
.PHONY: test-headscale
test-headscale:
HEADSCALE_IMAGE=headscale/headscale:0.22 USE_HEADSCALE=true poetry run molecule test --scenario-name default