You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A variable in the top of the makefile tries to get the git-revision. However, when it is mounted into the startup.go build container, it doesn't have access to the .git from it's parent directory, since that is not volume mounted in.
Running make dist/startup will print the following error:
fatal: Not a git repository (or any parent up to mount point /go/src/github.com/projectcalico/calico/calico_node). Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
$ make dist/startup
mkdir -p dist
mkdir -p .go-pkg-cache
docker run --rm \
-e LOCAL_USER_ID=1000 \
-v /home/turk/go/src/github.com/projectcalico/calico/calico_node/.go-pkg-cache:/go/pkg/:rw \
-v /home/turk/go/src/github.com/projectcalico/calico/calico_node:/go/src/github.com/projectcalico/calico/calico_node:ro \
-v /home/turk/go/src/github.com/projectcalico/calico/calico_node/dist:/go/src/github.com/projectcalico/calico/calico_node/dist \
-v /home/turk/go/src/github.com/projectcalico/calico/calico_node//../_data/versions.yml:/versions.yaml:ro \
-e VERSIONS_FILE=/versions.yaml \
calico/go-build:latest sh -c '\
cd /go/src/github.com/projectcalico/calico/calico_node && \
make startup'
Starting with UID : 1000
fatal: Not a git repository (or any parent up to mount point /go/src/github.com/projectcalico/calico/calico_node)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -v -i -o dist/startup -ldflags "-X main.VERSION=v2.3.0 -X main.GIT_REVISION=" startup/startup.go
command-line-arguments
Context
I'm trying to add versioning to startup.go.
The text was updated successfully, but these errors were encountered:
Change CALICO_GIT_VER to a "conditional variable". The git shell command
will only be run if a value isn't already defined.
This allows the non-containerized execution of `make` to fill in the
variable so that that git doesn't need to run inside the container.
Fixesprojectcalico#897
Expected Behavior
Current Behavior
A variable in the top of the makefile tries to get the git-revision. However, when it is mounted into the startup.go build container, it doesn't have access to the
.git
from it's parent directory, since that is not volume mounted in.CALICO_GIT_VER := $(shell git describe --tags --dirty --always)
Possible Solution
Steps to Reproduce (for bugs)
Running
make dist/startup
will print the following error:fatal: Not a git repository (or any parent up to mount point /go/src/github.com/projectcalico/calico/calico_node). Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
Context
I'm trying to add versioning to startup.go.
The text was updated successfully, but these errors were encountered: