From cd765c2f0e0fc0fe3ada19503df3005ea01ca637 Mon Sep 17 00:00:00 2001 From: Luis Davim Date: Wed, 23 Oct 2019 17:42:01 +0100 Subject: [PATCH] Fix the docker build --- Gopkg.lock | 15 --------------- Makefile | 16 +++++++++------- dockerfile/dockerfile | 5 +---- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index c1307022..ba0fa895 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -41,18 +41,6 @@ revision = "3012a1dbe2e4bd1391d42b32f0577cb7bbc7f005" version = "v0.3.1" -[[projects]] - branch = "master" - digest = "1:6b0fcd019bd122e25de32a7e4c1f9ab6e5413cb8c6e508d882b211d2e2f6e629" - name = "github.com/Praqma/helmsman" - packages = [ - "aws", - "azure", - "gcs", - ] - pruneopts = "UT" - revision = "ed3dc3cc70ccc4bef59acf19d4f4fb79f38529e9" - [[projects]] digest = "1:c78f02a2c6a138255ce52eefe18b62fe4e89815e4289819582c643ce51cdbf84" name = "github.com/aws/aws-sdk-go" @@ -355,9 +343,6 @@ "github.com/Azure/azure-pipeline-go/pipeline", "github.com/Azure/azure-storage-blob-go/azblob", "github.com/BurntSushi/toml", - "github.com/Praqma/helmsman/aws", - "github.com/Praqma/helmsman/azure", - "github.com/Praqma/helmsman/gcs", "github.com/aws/aws-sdk-go/aws", "github.com/aws/aws-sdk-go/aws/session", "github.com/aws/aws-sdk-go/service/s3", diff --git a/Makefile b/Makefile index d62a00fb..ae67b49d 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,12 @@ ifeq ($(strip $(GOPATH)),) endif SRCDIR := $(GOPATH)/src/ +PRJDIR := $(CURDIR) ifeq ($(filter $(GOPATH)%,$(CURDIR)),) GOPATH := $(shell mktemp -d "/tmp/dep.XXXXXXXX") SRCDIR := $(GOPATH)/src/ + PRJDIR := $(SRCDIR)helmsman endif ifneq ($(OS),Windows_NT) @@ -56,17 +58,17 @@ $(SRCDIR): @ln -s $(CURDIR) $(SRCDIR) dep: $(SRCDIR) ## Ensure vendors with dep - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ dep ensure .PHONY: dep dep-update: $(SRCDIR) ## Ensure vendors with dep - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ dep ensure --update .PHONY: dep-update build: dep ## Build the package - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ CGO_ENABLED=0 go build -ldflags '-X main.version="${TAG}-${DATE}" -extldflags "-static"' generate: @@ -74,24 +76,24 @@ generate: .PHONY: generate check: $(SRCDIR) - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ dep check && \ go vet #${PKGS} .PHONY: check test: dep ## Run unit tests - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ helm init --client-only && \ CGO_ENABLED=0 go test -v -cover -p=1 -args -f example.toml .PHONY: test cross: dep ## Create binaries for all OSs - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ env CGO_ENABLED=0 gox -os '!freebsd !netbsd' -arch '!arm' -output "dist/{{.Dir}}_{{.OS}}_{{.Arch}}" -ldflags '-X main.Version=${TAG}-${DATE}' .PHONY: cross release: dep ## Generate a new release - @cd $(SRCDIR)helmsman && \ + @cd $(PRJDIR) && \ goreleaser --release-notes release-notes.md --rm-dist tools: ## Get extra tools used by this makefile diff --git a/dockerfile/dockerfile b/dockerfile/dockerfile index ea362bbd..b0f9610a 100644 --- a/dockerfile/dockerfile +++ b/dockerfile/dockerfile @@ -15,10 +15,7 @@ RUN cd helmsman \ && LT_SHA=$(git rev-parse ${LastTag}^{}) \ && LC_SHA=$(git rev-parse HEAD) \ && if [ ${LT_SHA} != ${LC_SHA} ]; then TAG=latest-$(date +"%d%m%y"); fi \ - && dep ensure \ && make build - # && CGO_ENABLED=0 GOOS=linux go install -a -ldflags '-X main.version='$TAG' -extldflags "-static"' . - # The image to keep FROM alpine:3.10 @@ -41,7 +38,7 @@ RUN apk --no-cache update \ && rm -rf /tmp/linux-amd64 \ && chmod +x /usr/local/bin/helm -COPY --from=builder /go/bin/helmsman /bin/helmsman +COPY --from=builder /go/src/helmsman/helmsman /bin/helmsman RUN mkdir -p ~/.helm/plugins \ && helm plugin install https://github.com/hypnoglow/helm-s3.git \