From 4973514bd6379010b8e54e45131006e0adc1fa40 Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Tue, 26 Jun 2018 12:02:33 +0100 Subject: [PATCH] Use goreleaser binaries when making docker image --- .circleci/config.yml | 15 +++++++-------- .goreleaser.yml | 6 ++++-- Dockerfile | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f34d91ce4..763212874 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,9 +17,7 @@ workflows: only: master - deploy_docker: requires: - - test - - coverage - - lint + - deploy_github_release filters: branches: only: master @@ -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] @@ -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 diff --git a/.goreleaser.yml b/.goreleaser.yml index c4e4343a6..0a4423235 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,10 +1,12 @@ +project_name: circleci-cli + archive: format_overrides: - goos: windows format: zip - + builds: - - binary: circleci-beta + - binary: circleci goos: - windows - darwin diff --git a/Dockerfile b/Dockerfile index 18a104906..88262d291 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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