Skip to content

Commit

Permalink
Use goreleaser binaries when making docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomorain committed Jun 26, 2018
1 parent 79bf3a8 commit 4973514
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
15 changes: 7 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ workflows:
only: master
- deploy_docker:
requires:
- test
- coverage
- lint
- deploy_github_release
filters:
branches:
only: master
Expand Down Expand Up @@ -103,6 +101,10 @@ jobs:
- run:
name: Release
command: goreleaser
- persist_to_workspace:
root: .
paths:
- dist
- save_cache:
key: v2-goreleaser-{{ checksum "~/goreleaser_amd64.deb" }}
paths: [~/goreleaser_amd64.deb]
Expand All @@ -115,14 +117,11 @@ jobs:
CONTAINER_ORG: circlecidx
DOCKERFILE_PATH: Dockerfile
DOCKER_REGISTRY: dockerhub
working_directory: /go/src/github.com/circleci/circleci-cli
steps:
- setup_docker_engine:
docker_layer_caching: true
- checkout
- run:
name: Build the binary
command: make
- attach_workspace:
at: ~/workspace
- run:
name: Build and push circleci-cli image
command: publish
Expand Down
6 changes: 4 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
project_name: circleci-cli

archive:
format_overrides:
- goos: windows
format: zip

builds:
- binary: circleci-beta
- binary: circleci
goos:
- windows
- darwin
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM circleci/golang:1.10.3

COPY build/linux/amd64/circleci-cli /usr/local/bin/
COPY ~/workspace/dist/linux_amd64/circleci /usr/local/bin

0 comments on commit 4973514

Please sign in to comment.