diff --git a/.circleci/config.yml b/.circleci/config.yml index f34d91ce4..7187f3070 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,15 +7,7 @@ workflows: - test - coverage - lint - - deploy_github_release: - requires: - - test - - coverage - - lint - filters: - branches: - only: master - - deploy_docker: + - deploy: requires: - test - coverage @@ -76,7 +68,7 @@ jobs: key: v1-gometalinter-{{ checksum "/go/bin/gometalinter" }} paths: [/go/bin/*] - deploy_github_release: + deploy: working_directory: /go/src/github.com/circleci/circleci-cli docker: - image: circleci/golang:1.10 @@ -103,31 +95,14 @@ jobs: - run: name: Release command: goreleaser + - setup_remote_docker: + docker_layer_caching: true + - run: + name: Build Docker Image + command: | + docker build -t circlecidx/circleci-cli:0.1.$CIRCLE_BUILD_NUM . + docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD + docker push circlecidx/circleci-cli:0.1.$CIRCLE_BUILD_NUM - save_cache: key: v2-goreleaser-{{ checksum "~/goreleaser_amd64.deb" }} paths: [~/goreleaser_amd64.deb] - - deploy_docker: - docker: - - image: circleci/command-convenience:0.1.392-2e3ae33 - environment: - NAME: circleci-cli - 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 - - run: - name: Build and push circleci-cli image - command: publish - - run: - name: Update the "latest" tag - command: publish - environment: - CONTAINER_VERSION: latest 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..b531b92e5 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 ./dist/linux_amd64/circleci /usr/local/bin