Skip to content

Commit

Permalink
fix build (#165)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkubala authored Jul 18, 2018
1 parent 44e5f08 commit 57e9103
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerfile used to build a build step that builds container-diff in CI.
# Dockerfile used to build a build step that builds container-structure-test in CI.
FROM golang:1.9
RUN apt-get update && apt-get install make
RUN mkdir -p /go/src/github.com/GoogleContainerTools/
RUN ln -s /workspace /go/src/github.com/GoogleContainerTools/container-diff
WORKDIR /go/src/github.com/GoogleContainerTools/container-diff
RUN mkdir -p /go/src/github.com/GoogleContainerTools
RUN ln -s /workspace /go/src/github.com/GoogleContainerTools/container-structure-test
WORKDIR /go/src/github.com/GoogleContainerTools/container-structure-test
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ VERSION ?= v$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_BUILD)

GOOS ?= $(shell go env GOOS)
GOARCH = amd64
ORG := github.com/GoogleContainerTools
PROJECT := container-structure-test
REPOPATH ?= $(ORG)/$(PROJECT)
RELEASE_BUCKET ?= gcp-container-tools/structure-test

LD_FLAGS := -X github.com/GoogleContainerTools/container-structure-test/pkg/version.version=$(VERSION)
Expand All @@ -33,11 +35,13 @@ BUILD_DIR ?= ./out
BUCKET ?= structure-test
UPLOAD_LOCATION := gs://${BUCKET}

BUILD_PACKAGE = $(REPOPATH)

$(BUILD_DIR)/$(PROJECT): $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH)
cp $(BUILD_DIR)/$(PROJECT)-$(GOOS)-$(GOARCH) $@

$(BUILD_DIR)/$(PROJECT)-%-$(GOARCH): $(GO_FILES) $(BUILD_DIR)
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags="$(LD_FLAGS)" -o $@ .
GOOS=$* GOARCH=$(GOARCH) CGO_ENABLED=0 go build -ldflags="$(LD_FLAGS)" -o $@ $(BUILD_PACKAGE)

%.sha256: %
shasum -a 256 $< &> $@
Expand Down

0 comments on commit 57e9103

Please sign in to comment.