Update OSS semaphore jobs that depend on glide (local_build needs to run inside a docker)
Update OSS semaphore jobs that depend on glide (local_build needs to run inside a docker)
@@ -38,19 +38,6 @@ ifeq ($(ARCH),x86_64)
override ARCH=amd64
endif
-# Build mounts for running in "local build" mode. This allows an easy build using local development code,
-# assuming that there is a local checkout of libcalico in the same directory as this repo.
-PHONY:local_build
-
-ifdef LOCAL_BUILD
-EXTRA_DOCKER_ARGS+=-v $(CURDIR)/../libcalico-go:/go/src/github.com/projectcalico/libcalico-go:rw
-local_build:
- go mod edit -replace=github.com/projectcalico/libcalico-go=../libcalico-go
-else
-local_build:
- -go mod edit -dropreplace=github.com/projectcalico/libcalico-go
-endif
-
# we want to be able to run the same recipe on multiple targets keyed on the image name
# to do that, we would use the entire image name, e.g. calico/node:abcdefg, as the stem, or '%', in the target
# however, make does **not** allow the usage of invalid filename characters - like / and : - in a stem, and thus errors out
@@ -172,6 +159,19 @@ DOCKER_RUN := mkdir -p .go-pkg-cache && \
-v $(CURDIR)/.go-pkg-cache:/go-cache:rw \
-w /go/src/$(PACKAGE_NAME)
+# Build mounts for running in "local build" mode. This allows an easy build using local development code,
+# assuming that there is a local checkout of libcalico in the same directory as this repo.
+PHONY:local_build
+
+ifdef LOCAL_BUILD
+EXTRA_DOCKER_ARGS+=-v $(CURDIR)/../libcalico-go:/go/src/github.com/projectcalico/libcalico-go:rw
+local_build:
+ $(DOCKER_RUN) $(CALICO_BUILD) go mod edit -replace=github.com/projectcalico/libcalico-go=../libcalico-go
+else
+local_build:
+ -$(DOCKER_RUN) $(CALICO_BUILD) go mod edit -dropreplace=github.com/projectcalico/libcalico-go
+endif
+
# Default the libcalico repo and version but allow them to be overridden
LIBCALICO_BRANCH?=$(shell git rev-parse --abbrev-ref HEAD)
LIBCALICO_REPO?=github.com/projectcalico/libcalico-go
