From edde42af98588e55f0ba6599290536cc6f4b2f2d Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 14 Oct 2019 14:37:48 +0200 Subject: [PATCH] Support CI testing against a bots project PR * If `$COCKPIT_BOTS_REF` is set, check out that bots version instead of master. * Use git cache in $XDG_CACHE_HOME if available. Our CI uses that to save downloads, and it does not get in the way for local developers. Adapted from https://github.com/cockpit-project/starter-kit/pull/233 Cherry-picked from master commit a2c67385e478. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e350f989..780d1a7c 100644 --- a/Makefile +++ b/Makefile @@ -142,8 +142,11 @@ vm-reset: # checkout Cockpit's bots for standard test VM images and API to launch them # must be from master, as only that has current and existing images; but testvm.py API is stable +# support CI testing against a bots change bots: - git clone --depth=1 https://github.com/cockpit-project/bots.git + git clone --quiet --reference-if-able $${XDG_CACHE_HOME:-$$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git + if [ -n "$$COCKPIT_BOTS_REF" ]; then git -C bots fetch --quiet --depth=1 origin "$$COCKPIT_BOTS_REF"; git -C bots checkout --quiet FETCH_HEAD; fi + @echo "checked out bots/ ref $$(git -C bots rev-parse HEAD)" .PHONY: ci_after_success ci_after_success: