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