From c2f4c045724e9a193b8c763d45da5c8d35fc1d5b Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Fri, 8 Dec 2017 22:54:53 -0600 Subject: [PATCH 1/2] Makefile: wait for old pod to terminate --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2b64a6a3..706685a1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,8 @@ INTERVAL ?= 86400 build_cmd = mkdir -p _output && GOOS=linux go build -o _output/$(1) ./cmd/$(1) prepare_spec = sed 's,DOCKER_IMAGE,$(DOCKER_REPO),g' +SHELL := /bin/bash + build: $(call build_cmd,collapsed-kube-commit-mapper) $(call build_cmd,publishing-bot) @@ -35,8 +37,9 @@ update-deps: .PHONY: update-deps init-deploy: - $(KUBECTL) delete -n "$(NAMESPACE)" rc publisher || true - $(KUBECTL) delete -n "$(NAMESPACE)" pod publisher || true + $(KUBECTL) delete -n "$(NAMESPACE)" --ignore-not-found=true rc publisher + $(KUBECTL) delete -n "$(NAMESPACE)" --ignore-not-found=true pod publisher + while $(KUBECTL) get pod publisher -a &>/dev/null; do echo -n .; sleep 1; done $(KUBECTL) apply -n "$(NAMESPACE)" -f artifacts/manifests/storage-class.yaml || true $(KUBECTL) get StorageClass ssd sed 's/TOKEN/$(shell echo "$(TOKEN)" | base64 | tr -d '\n')/g' artifacts/manifests/secret.yaml | $(KUBECTL) apply -n "$(NAMESPACE)" -f - From 72f923175c299811462b2e0b1ba0b412f7566081 Mon Sep 17 00:00:00 2001 From: "Dr. Stefan Schimanski" Date: Fri, 8 Dec 2017 22:55:26 -0600 Subject: [PATCH 2/2] Run 'dep init' to create Gopkg.{toml,lock} --- artifacts/scripts/initialize_repos.sh | 2 +- artifacts/scripts/util.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/artifacts/scripts/initialize_repos.sh b/artifacts/scripts/initialize_repos.sh index b703b4b1..27f6d5a6 100755 --- a/artifacts/scripts/initialize_repos.sh +++ b/artifacts/scripts/initialize_repos.sh @@ -35,7 +35,7 @@ popd go get github.com/golang/dep pushd ${GOPATH}/src/github.com/golang/dep - git checkout 7c44971bbb9f0ed87db40b601f2d9fe4dffb750d + git checkout 3a59b68597c76c889b2ff2854b30bc29e902b555 go install ./cmd/dep popd diff --git a/artifacts/scripts/util.sh b/artifacts/scripts/util.sh index b2bc5fba..bcd097e9 100755 --- a/artifacts/scripts/util.sh +++ b/artifacts/scripts/util.sh @@ -621,6 +621,17 @@ function fix-godeps() { fi fi + # run golang dep + echo "Running dep init." + rm -rf vendor/ + dep init -gopath + git add Gopkg.{toml,lock} + if ! git diff-index --quiet --cached HEAD -- ; then + git commit -q -m "sync: run golang/dep" + fi + rm -rf vendor/ + git reset --hard + # amend godep commit to ${dst_old_commit} if ! git diff --exit-code ${dst_old_commit} &>/dev/null && [ "${squash}" = true ]; then echo "Amending last merge with godep changes."