diff --git a/Makefile b/Makefile index d913360ed..a00b2d386 100644 --- a/Makefile +++ b/Makefile @@ -34,13 +34,11 @@ GO_LDFLAGS += -X $(VERSION_PACKAGE).version=$(VERSION) GO_LDFLAGS += -w -s # Drop debugging symbols. GO_LDFLAGS += ' -GO_BUILD_TAGS := "containers_image_ostree_stub containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs exclude_graphdriver_overlay" - EXECUTOR_PACKAGE = $(REPOPATH)/cmd/executor KANIKO_PROJECT = $(REPOPATH)/kaniko out/executor: $(GO_FILES) - GOARCH=$(GOARCH) GOOS=linux CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS) -tags $(GO_BUILD_TAGS) -o $@ $(EXECUTOR_PACKAGE) + GOARCH=$(GOARCH) GOOS=linux CGO_ENABLED=0 go build -ldflags $(GO_LDFLAGS) -o $@ $(EXECUTOR_PACKAGE) .PHONY: test test: out/executor @@ -51,5 +49,5 @@ integration-test: @ ./integration-test.sh .PHONY: images -images: out/executor +images: docker build -t $(REGISTRY)/executor:latest -f deploy/Dockerfile . diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 83c5627c4..227a184c7 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -14,11 +14,10 @@ # Builds the static Go image to execute in a Kubernetes job -FROM golang +FROM golang:1.10 WORKDIR /go/src/github.com/GoogleContainerTools/kaniko -RUN apt-get update && apt-get install -y make COPY . . -RUN make -B +RUN make FROM scratch COPY --from=0 /go/src/github.com/GoogleContainerTools/kaniko/out/executor /kaniko/executor diff --git a/test.sh b/test.sh index 1ca29155d..d797d9f7a 100755 --- a/test.sh +++ b/test.sh @@ -21,7 +21,7 @@ GREEN='\033[0;32m' RESET='\033[0m' echo "Running go tests..." -go test -cover -v -tags "containers_image_ostree_stub containers_image_openpgp exclude_graphdriver_devicemapper exclude_graphdriver_btrfs" -timeout 60s `go list ./... | grep -v vendor` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/'' +go test -cover -v -timeout 60s `go list ./... | grep -v vendor` | sed ''/PASS/s//$(printf "${GREEN}PASS${RESET}")/'' | sed ''/FAIL/s//$(printf "${RED}FAIL${RESET}")/'' GO_TEST_EXIT_CODE=${PIPESTATUS[0]} if [[ $GO_TEST_EXIT_CODE -ne 0 ]]; then exit $GO_TEST_EXIT_CODE