run-success.mk: Record last successful run
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m16s
CI / Packaging test (push) Successful in 0s
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m16s
CI / Packaging test (push) Successful in 0s
Add a run-success.mk which provides a $(RUN_SUCCESS_CREATE_MARKER) variable, and include it from run.mk and py-run.mk. If it's not overridden, it logs the current commit to a marker file if the run succeeds. The marker file is ignored from Git and cleaned in the context of the distclean target. The machinery can be customized by variables: RUN_SUCCESS_MARKER is the name of the marker file RUN_SUCCESS_RECORD_CMD is the generator for its content For example, putting this into local.mk or jw-pkg/make/local.mk will record the hashes of every repository in the entire workspace: define RUN_SUCCESS_RECORD_CMD make git-log-1 make git-log-tree-1 endef Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
24fec38f75
commit
2fcda74277
5 changed files with 24 additions and 5 deletions
15
make/run-success.mk
Normal file
15
make/run-success.mk
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
ifndef RUN_SUCCESS_RECORD_CMD
|
||||
RUN_SUCCESS_RECORD_CMD := git log --oneline -1
|
||||
endif
|
||||
|
||||
ifndef RUN_SUCCESS_MARKER
|
||||
RUN_SUCCESS_MARKER := last-successful-run.txt
|
||||
endif
|
||||
|
||||
RUN_SUCCESS_CREATE_MARKER = $(RUN_SUCCESS_RECORD_CMD) > $(RUN_SUCCESS_MARKER).tmp && \
|
||||
mv $(RUN_SUCCESS_MARKER).tmp $(RUN_SUCCESS_MARKER)
|
||||
all:
|
||||
|
||||
distclean: distclean.run-success
|
||||
distclean.run-success:
|
||||
rm -f $(RUN_SUCCESS_MARKER)
|
||||
Loading…
Reference in a new issue