From 35cb4d4032c46509be52b093b6a731e26f1bd5a7 Mon Sep 17 00:00:00 2001 From: Yusuke KUOKA Date: Mon, 9 Apr 2018 19:38:58 +0900 Subject: [PATCH 1/2] Redo release automation via CircleCI Resolves #91 --- .circleci/config.yml | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7472921..302517a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,13 +73,19 @@ jobs: make integration # GITHUB_TOKEN env var must be setup in circleci console -deployment: + release: - tag: /v.*/ - commands: - - docker login -e="." -u="$DOCKER_USER" -p="$DOCKER_PASS" quay.io - - cd "$WORK" && make tools - - cd "$WORK" && BUILD_URL="$CIRCLE_BUILD_URL" make push release + docker: + - image: circleci/golang:1.7 + working_directory: /go/src/github.com/roboll/helmfile + steps: + - checkout + - setup_remote_docker + - run: + command: | + docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" quay.io + make tools + BUILD_URL="$CIRCLE_BUILD_URL" make push release workflows: version: 2 @@ -94,4 +100,10 @@ workflows: branches: only: - master - - /pull.*/ \ No newline at end of file + - /pull.*/ + - release: + filters: + branches: + ignore: /.*/ + tags: + only: /v.*/ From 8c4ada4457996c800ada57ba7b411487225529bd Mon Sep 17 00:00:00 2001 From: Yusuke KUOKA Date: Mon, 9 Apr 2018 20:08:55 +0900 Subject: [PATCH 2/2] Allow overriding docker repository ORG name --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9ad1ed53..c02d0b2a 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -ORG := $(shell basename $(realpath ..)) +ORG ?= $(shell basename $(realpath ..)) PKGS := $(shell go list ./... | grep -v /vendor/) build: @@ -42,13 +42,13 @@ release: pristine cross .PHONY: release image: cross - docker build -t quay.io/roboll/helmfile:${TAG} . + docker build -t quay.io/${ORG}/helmfile:${TAG} . run: image - docker run --rm -it -t quay.io/roboll/helmfile:${TAG} sh + docker run --rm -it -t quay.io/${ORG}/helmfile:${TAG} sh push: image - docker push quay.io/roboll/helmfile:${TAG} + docker push quay.io/${ORG}/helmfile:${TAG} tools: go get -u github.com/tcnksm/ghr github.com/mitchellh/gox