From 4fd871789ad886ce197df7455107941f2d8eadc6 Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Fri, 22 Jun 2018 13:16:32 +0100 Subject: [PATCH 1/4] Local expansion --- cmd/config.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/config.go b/cmd/config.go index 509d89458..d6022df8e 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -123,6 +123,7 @@ func configQuery(ctx context.Context) (*buildConfigResponse, error) { } func validateConfig(cmd *cobra.Command, args []string) error { + ctx := context.Background() response, err := configQuery(ctx) @@ -140,6 +141,7 @@ func validateConfig(cmd *cobra.Command, args []string) error { func expandConfig(cmd *cobra.Command, args []string) error { ctx := context.Background() + response, err := configQuery(ctx) if err != nil { From 7ba4863000d3ca751305199d3d30eb5eaac7055e Mon Sep 17 00:00:00 2001 From: Marc O'Morain Date: Fri, 22 Jun 2018 15:30:38 +0100 Subject: [PATCH 2/4] dockerfiles --- .circleci/config.yml | 12 ++++++++++++ Dockerfile | 3 +++ Makefile | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.circleci/config.yml b/.circleci/config.yml index 9505556f9..50bebb5ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,19 @@ jobs: key: v1-gometalinter-{{ checksum "/go/bin/gometalinter" }} paths: [/go/bin/*] + # Build a docker image + docker: + docker: + - image: circleci/golang:1.10.3 + steps: + - checkout + - setup_remote_docker + - run: make + - run: + + deploy: + working_directory: /go/src/github.com/circleci/circleci-cli docker: - image: circleci/golang:1.10 environment: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..18a104906 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM circleci/golang:1.10.3 + +COPY build/linux/amd64/circleci-cli /usr/local/bin/ diff --git a/Makefile b/Makefile index ef62acb69..6e25fbd62 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION=0.1 GOFILES = $(shell find . -name '*.go' -not -path './vendor/*') -OS = $(shell uname) +OS ?= $(shell uname) CLIPATH=github.com/CircleCI-Public/circleci-cli From f980f3507688316333bab9d86cf700f131484f27 Mon Sep 17 00:00:00 2001 From: ndintenfass Date: Sun, 24 Jun 2018 17:45:42 -0700 Subject: [PATCH 3/4] make the build green on this branch, hopefully --- .circleci/config.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 50bebb5ba..4194feaed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,15 +69,13 @@ jobs: paths: [/go/bin/*] # Build a docker image - docker: + build-docker: docker: - image: circleci/golang:1.10.3 - steps: + steps: - checkout - setup_remote_docker - run: make - - run: - deploy: working_directory: /go/src/github.com/circleci/circleci-cli From 79bf3a8bf01d9105a2bdd5e6d015a42ac9692a0b Mon Sep 17 00:00:00 2001 From: hannahhenderson Date: Mon, 25 Jun 2018 09:12:27 -0700 Subject: [PATCH 4/4] Add deploy_docker --- .circleci/config.yml | 46 +++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4194feaed..f34d91ce4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,15 @@ workflows: - test - coverage - lint - - deploy: + - deploy_github_release: + requires: + - test + - coverage + - lint + filters: + branches: + only: master + - deploy_docker: requires: - test - coverage @@ -68,16 +76,7 @@ jobs: key: v1-gometalinter-{{ checksum "/go/bin/gometalinter" }} paths: [/go/bin/*] - # Build a docker image - build-docker: - docker: - - image: circleci/golang:1.10.3 - steps: - - checkout - - setup_remote_docker - - run: make - - deploy: + deploy_github_release: working_directory: /go/src/github.com/circleci/circleci-cli docker: - image: circleci/golang:1.10 @@ -107,3 +106,28 @@ jobs: - 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