-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommon.mk
38 lines (28 loc) · 1.12 KB
/
common.mk
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
# By convention, the default target is `all`
all:
# Users need to provide a buildkite agent token file
BUILDKITE_AGENT_TOKEN_FILE=$(REPO_ROOT)/secrets/buildkite-agent-token
$(BUILDKITE_AGENT_TOKEN_FILE):
@echo "You must add a $(BUILDKITE_AGENT_TOKEN_FILE) file and populate it!"
@exit 1
# Users need to provide packer with windows credentials
SECRET_VARIABLES_FILE=$(REPO_ROOT)/secrets/credentials.pkrvars.hcl
$(SECRET_VARIABLES_FILE):
@echo "You must create a $(SECRET_VARIABLES_FILE) file and populate it like so:"
@echo
@echo " # main user account password (on Windows, also the Administrator password)"
@echo " password = \"foo\""
@echo
@exit 1
# Default packer args are to include the secret variables file
PACKER_ARGS := -var-file="$(SECRET_VARIABLES_FILE)"
# Literal values that are hard to use in Makefiles otherwise:
define newline # a literal \n
endef
COMMA:=,
SPACE:=$(eval) $(eval)
# Makefile debugging trick:
# call print-VARIABLE to see the runtime value of any variable
# (hardened against any special characters appearing in the output)
print-%:
@echo '$*=$(subst ','\'',$(subst $(newline),\n,$($*)))'