github.com/projectcalico/api@v0.0.0-20231218190037-9183ab93f33e/Makefile.local (about) 1 # This is the local Makefile for the projectcalico/api repository, with targets 2 # specific to github.com/projectcalico/api. This is opposed to Makefile, which 3 # is mirrored from github.com/projectcalico/calico/api. 4 5 # update pulls in the latest contents of this repository from the upstream 6 # github.com/projectcalico/calico/api directory. 7 CALICO_VERSION ?= $(shell git rev-parse --abbrev-ref HEAD) 8 update: check-dirty 9 # Clone a temporary copy of the Calico repo at the given version. 10 rm -rf /tmp/calico-api-mirror 11 mkdir -p /tmp/calico-api-mirror 12 git clone --depth 1 git@github.com:projectcalico/calico.git -b $(CALICO_VERSION) /tmp/calico-api-mirror 13 # Remove local files - we'll add them back from the Calico repo's contents. 14 rm -r pkg/ build/ examples/ hack/ 15 # Add in files from the Calico repo. 16 cp -r /tmp/calico-api-mirror/api/. . 17 cp /tmp/calico-api-mirror/lib.Makefile . 18 cp /tmp/calico-api-mirror/metadata.mk . 19 # Some files, we want to keep the local versions of. 20 # For example, README content is different between the two locations. 21 git checkout Makefile.local README.md 22 23 check-dirty: 24 git diff --quiet || (echo "Repository has local changes" && exit 1)