-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsops-generate.mk
46 lines (36 loc) · 1014 Bytes
/
sops-generate.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
39
40
41
42
43
44
45
46
ifndef _MK_SOPS_GENERATE_MK_
_MK_SOPS_GENERATE_MK_ := 1
#$(info ---> .make/sops-generate.mk)
nosops ?=
NO_SOPS ?=
skip_sops_check ?=
ifeq ($(NO_SOPS),1)
nosops := 1
skip_sops_check := 1
endif
ifneq ($(skip_sops_check),1)
ifndef GIT_ROOT
GIT_ROOT := $(shell git rev-parse --show-toplevel 2>/dev/null)
endif
ifndef MK_DIR
MK_DIR := $(GIT_ROOT)/.make
endif
include $(MK_DIR)/git.mk
#
# Generate the SOPS_KEYS_ORG default value, based on the repository
# name or the organization name
#
$(GIT_ROOT)/.sops-variables.mk:
echo "Generating $(@F)..."
set -x ; if [[ $$(uname -n) =~ BT-* ]] ; then \
echo "SOPS_KEYS_ORG := org1" > $@ ; \
else \
echo "SOPS_KEYS_ORG := ekgf" > $@ ; \
echo "export TF_VAR_org_short := ekgf" >> $@ ; \
echo "export TF_VAR_project_short := dt" >> $@ ; \
echo "export TF_VAR_project_long := digital-twin" >> $@ ; \
echo "export TF_VAR_project_label := Digital Twin" >> $@ ; \
fi
endif # skip_sops_check
#$(info <--- .make/sops-generate.mk)
endif # _MK_SOPS_GENERATE_MK_