Skip to content

Commit

Permalink
Fill out containerd's Revision variable correctly
Browse files Browse the repository at this point in the history
As like containerd's Makefile, we can fill out version.Revision to
make our life easier.

https://github.com/containerd/containerd/blob/0a1f2b40642e54ed06cd0a22cdf6025cbe70853c/Makefile#L24
  • Loading branch information
kzys committed Jan 9, 2020
1 parent 5606c60 commit 11cd5eb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions firecracker-control/cmd/containerd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@ EXTRAGOARGS:=
SRC := $(shell find . -name '*.go')
GOMOD := $(shell go env GOMOD)
GOSUM := $(GOMOD:.mod=.sum)
REVISION=$(shell git rev-parse HEAD)
VERSION_LDFLAGS="-X github.com/containerd/containerd/version.Revision=$(REVISION)"

all: build

build: firecracker-containerd firecracker-ctr

firecracker-containerd: $(SRC) $(GOMOD) $(GOSUM)
go build $(EXTRAGOARGS) -o firecracker-containerd
go build $(EXTRAGOARGS) \
-ldflags $(VERSION_LDFLAGS) -o firecracker-containerd

firecracker-ctr: $(GOMOD) $(GOSUM)
GOBIN=$(CURDIR) go install -tags=no_cri $(EXTRAGOARGS) github.com/containerd/containerd/cmd/ctr
GOBIN=$(CURDIR) go install -tags=no_cri $(EXTRAGOARGS) \
-ldflags $(VERSION_LDFLAGS) github.com/containerd/containerd/cmd/ctr
mv ctr firecracker-ctr

install: firecracker-containerd firecracker-ctr
Expand Down

0 comments on commit 11cd5eb

Please sign in to comment.