-
-
Notifications
You must be signed in to change notification settings - Fork 127
/
Makefile.init
39 lines (32 loc) · 1.51 KB
/
Makefile.init
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
GITHUB_TEMPLATES = \
.github/CODEOWNERS \
.github/PULL_REQUEST_TEMPLATE.md \
.github/ISSUE_TEMPLATE/config.yml \
.github/ISSUE_TEMPLATE/feature_request.md \
.github/ISSUE_TEMPLATE/bug_report.md \
.github/ISSUE_TEMPLATE/question.md \
.github/auto-release.yml \
.github/workflows/auto-release.yml \
.github/workflows/validate-codeowners.yml
# Install extra configuration for terraform projects
GITHUB_TERRAFORM_TEMPLATES = .github/workflows/chatops.yml \
.github/workflows/auto-context.yml \
.github/workflows/auto-format.yml \
.github/mergify.yml \
.github/renovate.json
$(GITHUB_TEMPLATES): $(addprefix $(BUILD_HARNESS_PATH)/templates/, $(GITHUB_TEMPLATES))
mkdir -p $(dir $@)
cp $(BUILD_HARNESS_PATH)/templates/$@ $@
git ls-files --error-unmatch $@ 2>/dev/null || git add $@
$(GITHUB_TERRAFORM_TEMPLATES): $(addprefix $(BUILD_HARNESS_PATH)/templates/terraform/, $(GITHUB_TERRAFORM_TEMPLATES))
mkdir -p $(dir $@)
cp $(BUILD_HARNESS_PATH)/templates/terraform/$@ $@
git ls-files --error-unmatch $@ 2>/dev/null || git add $@
github/init/context.tf:
curl -o context.tf -fsSL https://raw.githubusercontent.com/cloudposse/terraform-null-label/master/exports/context.tf
git ls-files --error-unmatch context.tf 2>/dev/null || git add context.tf
@if [[ -d examples/complete ]]; then \
cp -p context.tf examples/complete/context.tf ; \
fi
.PHONY: $(GITHUB_TEMPLATES) $(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf
github/init: $(GITHUB_TEMPLATES) $(if $(wildcard *.tf),$(GITHUB_TERRAFORM_TEMPLATES) github/init/context.tf)