Skip to content

Commit

Permalink
Fix released image to output desired version
Browse files Browse the repository at this point in the history
  • Loading branch information
errordeveloper committed Mar 26, 2019
1 parent ab3815d commit 93cb64d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ ARG COVERALLS_TOKEN
ENV COVERALLS_TOKEN $COVERALLS_TOKEN

ARG TEST_TARGET
ARG GO_BUILD_TAGS

ENV JUNIT_REPORT_DIR $GOPATH/src/github.com/weaveworks/eksctl/test-results/ginkgo
RUN mkdir -p "${JUNIT_REPORT_DIR}"

WORKDIR $EKSCTL
RUN make $TEST_TARGET
RUN make build \
RUN make build GO_BUILD_TAGS="${GO_BUILD_TAGS}" \
&& cp ./eksctl /out/usr/local/bin/eksctl
RUN make build-integration-test \
&& mkdir -p /out/usr/local/share/eksctl \
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version_pkg := github.com/weaveworks/eksctl/pkg/version
EKSCTL_BUILD_IMAGE ?= weaveworks/eksctl-build:latest
EKSCTL_IMAGE ?= weaveworks/eksctl:latest

GO_BUILD_TAGS ?= netgo

.DEFAULT_GOAL := help

##@ Dependencies
Expand All @@ -18,7 +20,7 @@ install-build-deps: ## Install dependencies (packages and tools)

.PHONY: build
build: ## Build eksctl
@CGO_ENABLED=0 go build -tags "netgo" -ldflags "-X $(version_pkg).gitCommit=$(git_commit) -X $(version_pkg).builtAt=$(built_at)" ./cmd/eksctl
CGO_ENABLED=0 go build -tags "$(GO_BUILD_TAGS)" -ldflags "-X $(version_pkg).gitCommit=$(git_commit) -X $(version_pkg).builtAt=$(built_at)" ./cmd/eksctl

##@ Testing & CI

Expand Down Expand Up @@ -122,7 +124,10 @@ eksctl-build-image: ## Create the the eksctl build docker image
@-docker pull $(EKSCTL_BUILD_IMAGE)
@docker build --tag=$(EKSCTL_BUILD_IMAGE) --cache-from=$(EKSCTL_BUILD_IMAGE) ./build

EKSCTL_IMAGE_BUILD_ARGS := --build-arg=EKSCTL_BUILD_IMAGE=$(EKSCTL_BUILD_IMAGE)
EKSCTL_IMAGE_BUILD_ARGS := \
--build-arg=EKSCTL_BUILD_IMAGE=$(EKSCTL_BUILD_IMAGE) \
--build-arg=GO_BUILD_TAGS=$(GO_BUILD_TAGS)

ifneq ($(COVERALLS_TOKEN),)
EKSCTL_IMAGE_BUILD_ARGS += --build-arg=COVERALLS_TOKEN=$(COVERALLS_TOKEN)
endif
Expand Down
24 changes: 20 additions & 4 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ profiles:

- name: local
build:
local:
local:
push: false
useBuildkit: true
tagPolicy:
Expand All @@ -23,7 +23,7 @@ profiles:

- name: push-any-commit
build:
local:
local:
push: true
useBuildkit: true
artifacts:
Expand All @@ -36,9 +36,25 @@ profiles:
EKSCTL_BUILD_IMAGE: weaveworks/eksctl-build:local
TEST_TARGET: test

- name: push-release
build:
local:
push: true
useBuildkit: true
artifacts:
- image: weaveworks/eksctl-build
context: ./build
- image: weaveworks/eksctl
context: ./
docker:
buildArgs:
EKSCTL_BUILD_IMAGE: weaveworks/eksctl-build:local
TEST_TARGET: test
GO_BUILD_TAGS: netgo release

- name: local-from-cache
build:
local:
local:
push: false
useBuildkit: true
tagPolicy:
Expand All @@ -59,7 +75,7 @@ profiles:

- name: push-cache
build:
local:
local:
push: true
useBuildkit: true
tagPolicy:
Expand Down

0 comments on commit 93cb64d

Please sign in to comment.