-
Notifications
You must be signed in to change notification settings - Fork 7
/
core.ci.mk
95 lines (87 loc) · 2.72 KB
/
core.ci.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
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
90
91
92
93
94
95
# Adds a 'ci/<BRANCH>' target that will force push HEAD to the BRANCH,
# triggering a CI build on a specific CI platform.
#
# ------------------------------------------------------------------------------
#
# Adds a 'debug-ci/<BRANCH>' target that will force push a '[debug ci]' commit to the BRANCH,
# triggering a CI build on a specific CI platform, and start a debug session.
#
# ------------------------------------------------------------------------------
CI_PREFIX += \
appveyor \
bitrise \
buddy \
circle \
cirrus \
codeship \
drone \
github \
gitlab \
semaphore \
sourcehut \
travis \
CI_TARGETS += \
$(patsubst %,ci/%-\%,$(CI_PREFIX)) \
DEBUG_CI_TARGETS += \
$(patsubst %,debug-ci/%-\%,$(CI_PREFIX)) \
DEBUG_BOOTSTRAP_TARGETS += \
$(patsubst %,debug-bootstrap/%-\%,$(CI_PREFIX)) \
# ------------------------------------------------------------------------------
.PHONY: $(CI_TARGETS)
# NOTE: below is a workaround for 'make help-all' to work
ci/appveyor-%:
ci/bitrise-%:
ci/buddy-%:
ci/circle-%:
ci/cirrus-%:
ci/codeship-%:
ci/drone-%:
ci/github-%:
ci/gitlab-%:
ci/semaphore-%:
ci/sourcehut-%:
ci/travis-%:
$(CI_TARGETS):
ci/%: ## Force push to a CI branch.
$(eval BRANCH := $(@:ci/%=%))
$(GIT) push --force --no-verify $(GIT_REMOTE_OR_ORIGIN) head:refs/heads/$(BRANCH)
.PHONY: $(DEBUG_CI_TARGETS)
# NOTE: below is a workaround for 'make help-all' to work
debug-ci/appveyor-%:
debug-ci/bitrise:
debug-ci/buddy:
debug-ci/circle-%:
debug-ci/cirrus-%:
debug-ci/codeship-%:
debug-ci/drone-%:
debug-ci/github-%:
debug-ci/gitlab-%:
debug-ci/semaphore-%:
debug-ci/sourcehut-%:
debug-ci/travis-%:
$(DEBUG_CI_TARGETS):
debug-ci/%: ## Force push to a CI branch and debug post-ci-bootstrap (tmate session).
$(eval BRANCH := $(@:debug-ci/%=%))
$(ECHO) "$(GIT_COMMIT_MSG)" | $(GREP) -q "\[debug ci\]" || \
$(GIT) commit --allow-empty -m "$(GIT_COMMIT_MSG) [debug ci]"
$(GIT) push --force --no-verify $(GIT_REMOTE_OR_ORIGIN) head:refs/heads/$(BRANCH)
.PHONY: $(DEBUG_BOOTSTRAP_TARGETS)
# NOTE: below is a workaround for 'make help-all' to work
debug-bootstrap/appveyor-%:
debug-bootstrap/bitrise:
debug-bootstrap/buddy:
debug-bootstrap/bootstraprcle-%:
debug-bootstrap/bootstraprrus-%:
debug-bootstrap/codeship-%:
debug-bootstrap/drone-%:
debug-bootstrap/github-%:
debug-bootstrap/gitlab-%:
debug-bootstrap/semaphore-%:
debug-bootstrap/sourcehut-%:
debug-bootstrap/travis-%:
$(DEBUG_BOOTSTRAP_TARGETS):
debug-bootstrap/%: ## Force push to a CI branch and debug pre-bootstrap (tmate session).
$(eval BRANCH := $(@:debug-bootstrap/%=%))
$(ECHO) "$(GIT_COMMIT_MSG)" | $(GREP) -q "\[debug bootstrap\]" || \
$(GIT) commit --allow-empty -m "$(GIT_COMMIT_MSG) [debug bootstrap]"
$(GIT) push --force --no-verify $(GIT_REMOTE_OR_ORIGIN) head:refs/heads/$(BRANCH)