From 5386505910d8b6e5c685494e28d44b12046244d0 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 08:31:59 -0700 Subject: [PATCH 01/23] build: Correct version --- Makefile | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 0e0f80289e9d..f0631ac3128b 100644 --- a/Makefile +++ b/Makefile @@ -35,14 +35,7 @@ VERSION := latest endif ifneq ($(findstring release,$(GIT_BRANCH)),) -# this will be something like "v2.5" or "v3.7" -MAJOR_MINOR := v$(word 2,$(subst -, ,$(GIT_BRANCH))) -# if GIT_TAG is on HEAD, then this will be the same -GIT_LATEST_TAG := $(shell git tag --merged | tail -n1) -# only use the latest tag if it matches the correct major/minor version -ifneq ($(findstring $(MAJOR_MINOR),$(GIT_LATEST_TAG)),) -VERSION := $(GIT_LATEST_TAG) -endif +VERSION := $(shell git git tag --points-at=HEAD|grep ^v|head -n1) endif # MANIFESTS_VERSION is the version to be used for files in manifests and should always be latests unles we are releasing From 6541499f58ff7ab7399a52fb9b83ff180a865896 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:03:11 -0700 Subject: [PATCH 02/23] fix-3004 --- docs/releasing.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/docs/releasing.md b/docs/releasing.md index 8320dce9c8d6..17dc5993f995 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -16,7 +16,19 @@ To generate new manifests and perform basic checks: Publish the images and local Git changes (disabling K3D as this is faster and more reliable for releases): - make publish-release K3D=false + make publish-release K3D=false VERSION=v2.7.2 + +* [ ] Check the correct versions are printed: + +``` +docker run argoproj/workflow-controller:v2.7.2 version +docker run argoproj/argoexec:v2.7.2 version +docker run argoproj/argocli:v2.7.2 version +``` + +* [ ] Check the manifests contain the correct tags: https://raw.githubusercontent.com/argoproj/argo/v2.7.2/manifests/install.yaml + +### Release Notes Create [the release](https://github.com/argoproj/argo/releases) in Github. You can get some text for this using [Github Toolkit](https://github.com/alexec/github-toolkit): @@ -27,8 +39,28 @@ Release notes checklist: * [ ] All breaking changes are listed with migration steps * [ ] The release notes identify every publicly known vulnerability with a CVE assignment +### Update Stable Tag + If this is GA: * [ ] Update the `stable` tag + +``` +git tag -f stable +git push -f origin stable +``` + +* [ ] Check the manifests contain the correct tags: https://raw.githubusercontent.com/argoproj/argo/stable/manifests/install.yaml + +### Update Homebrew + +If this is GA: + * [ ] Update the [Homebrew tap](https://github.com/argoproj/homebrew-tap). +* [ ] Check Homebrew was successfully updated: + ``` + brew upgrade argoproj/tap/argo + argo version + ``` + From 019b88601595491f47051d1907720fdfaff6d28c Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:07:22 -0700 Subject: [PATCH 03/23] fix-3004 --- docs/releasing.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/releasing.md b/docs/releasing.md index 17dc5993f995..70622b34a364 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -18,6 +18,14 @@ Publish the images and local Git changes (disabling K3D as this is faster and mo make publish-release K3D=false VERSION=v2.7.2 +* [ ] Check the images were pushed successfully. + +``` +docker pull argoproj/workflow-controller:v2.7.2 +docker pull argoproj/argoexec:v2.7.2 +docker pull argoproj/argocli:v2.7.2 +``` + * [ ] Check the correct versions are printed: ``` From 159b351da0dabdaeb4da183f366079b71c33d6ed Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:12:50 -0700 Subject: [PATCH 04/23] fix-3004 --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index f0631ac3128b..59735e28f909 100644 --- a/Makefile +++ b/Makefile @@ -135,6 +135,9 @@ build: status clis executor-image controller-image manifests/install.yaml manife .PHONY: status status: # GIT_TAG=$(GIT_TAG), GIT_BRANCH=$(GIT_BRANCH), GIT_TREE_STATE=$(GIT_TREE_STATE), MANIFESTS_VERSION=$(MANIFESTS_VERSION), VERSION=$(VERSION), DEV_IMAGE=$(DEV_IMAGE), K3D=$(K3D) +ifeq ($(findstring release,$(GIT_BRANCH)),release) + git diff +else # cli From f3e56aa94ef8523d76227ac2c5f0a0f52edfc04f Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:14:39 -0700 Subject: [PATCH 05/23] fix-3004 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 59735e28f909..f35534819259 100644 --- a/Makefile +++ b/Makefile @@ -137,7 +137,7 @@ status: # GIT_TAG=$(GIT_TAG), GIT_BRANCH=$(GIT_BRANCH), GIT_TREE_STATE=$(GIT_TREE_STATE), MANIFESTS_VERSION=$(MANIFESTS_VERSION), VERSION=$(VERSION), DEV_IMAGE=$(DEV_IMAGE), K3D=$(K3D) ifeq ($(findstring release,$(GIT_BRANCH)),release) git diff -else +endif # cli From 4ca31cbc86f4181419c7abb5e5233af337e8213d Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:30:54 -0700 Subject: [PATCH 06/23] fix-3004 --- .circleci/config.yml | 2 +- Dockerfile | 11 ++++------- Makefile | 5 +---- ui/.yarnrc | 2 ++ 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b17e30add1f..2ff911affcfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -233,7 +233,7 @@ jobs: - yarn-packages-v3-{{ checksum "ui/yarn.lock" }} - run: name: Download dependencies - command: yarn --cwd ui install --frozen-lockfile --ignore-optional --non-interactive + command: yarn --cwd ui install # - run: yarn test - run: yarn --cwd ui build - run: yarn --cwd ui lint diff --git a/Dockerfile b/Dockerfile index 57d8d4236985..8f1821e8d8bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -75,7 +75,7 @@ FROM node:14.0.0 as argo-ui ADD ["ui", "."] -RUN yarn install --frozen-lockfile --ignore-optional --non-interactive +RUN yarn install RUN yarn build #################################################################################################### @@ -91,7 +91,6 @@ WORKDIR /go/src/github.com/argoproj/argo COPY . . # check we can use Git RUN git rev-parse HEAD -COPY --from=argo-ui node_modules ui/node_modules RUN mkdir -p ui/dist COPY --from=argo-ui dist/app ui/dist/app # stop make from trying to re-build this without yarn installed @@ -100,11 +99,9 @@ RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code RUN make argo-server.crt argo-server.key -RUN if [ "${IMAGE_OS}" = "linux" -a "${IMAGE_ARCH}" = "amd64" ]; then \ - make dist/argo-linux-amd64 dist/workflow-controller-linux-amd64 dist/argoexec-linux-amd64; \ - elif [ "${IMAGE_OS}" = "linux" -a "${IMAGE_ARCH}" = "arm64" ]; then \ - make dist/argo-linux-arm64 dist/workflow-controller-linux-arm64 dist/argoexec-linux-arm64; \ - fi +RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} +# double check dirtiness +RUN git diff --exit-code #################################################################################################### # argoexec diff --git a/Makefile b/Makefile index f35534819259..480fc48c43ff 100644 --- a/Makefile +++ b/Makefile @@ -135,9 +135,6 @@ build: status clis executor-image controller-image manifests/install.yaml manife .PHONY: status status: # GIT_TAG=$(GIT_TAG), GIT_BRANCH=$(GIT_BRANCH), GIT_TREE_STATE=$(GIT_TREE_STATE), MANIFESTS_VERSION=$(MANIFESTS_VERSION), VERSION=$(VERSION), DEV_IMAGE=$(DEV_IMAGE), K3D=$(K3D) -ifeq ($(findstring release,$(GIT_BRANCH)),release) - git diff -endif # cli @@ -148,7 +145,7 @@ ui/dist/node_modules.marker: ui/package.json ui/yarn.lock # Get UI dependencies @mkdir -p ui/node_modules ifeq ($(CI),false) - yarn --cwd ui install --frozen-lockfile --ignore-optional --non-interactive + yarn --cwd ui install endif @mkdir -p ui/dist touch ui/dist/node_modules.marker diff --git a/ui/.yarnrc b/ui/.yarnrc index 7be79daa709c..79ed41f3a46e 100644 --- a/ui/.yarnrc +++ b/ui/.yarnrc @@ -1,2 +1,4 @@ --add.ignore-optional true --install.ignore-optional true +--install.frozen-lockfile true +--install.non-interactive true From ae0ff78e16b3a9d0a90efc26917f252c138c23a4 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:33:16 -0700 Subject: [PATCH 07/23] fix-3004 --- Dockerfile | 5 +++-- Makefile | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8f1821e8d8bd..7e51e614de61 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,9 +99,10 @@ RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code RUN make argo-server.crt argo-server.key -RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} +RUN make dist/argo-linux-${IMAGE_ARCH} +# RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN git diff --exit-code +RUN ./dist/argo-linux-${IMAGE_ARCH} | grep clean #################################################################################################### # argoexec diff --git a/Makefile b/Makefile index 480fc48c43ff..0799c3667604 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ CONTROLLER_IMAGE_FILE := dist/controller-image.$(VERSION) STATIC_BUILD ?= true CI ?= false DB ?= postgres -K3D := $(shell if [ "`kubectl config current-context`" = "k3s-default" ]; then echo true; else echo false; fi) +K3D := $(shell if [ `which kubectl` != '' ] && [ "`kubectl config current-context`" = "k3s-default" ]; then echo true; else echo false; fi) # which components to start, useful if you want to disable them to debug COMPONENTS := controller,argo-server LOG_LEVEL := debug From f79c9cf556edb8c3cd5f6a211e5b3d3dc7683bf6 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:33:51 -0700 Subject: [PATCH 08/23] fix-3004 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0799c3667604..2f1798644237 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ CONTROLLER_IMAGE_FILE := dist/controller-image.$(VERSION) STATIC_BUILD ?= true CI ?= false DB ?= postgres -K3D := $(shell if [ `which kubectl` != '' ] && [ "`kubectl config current-context`" = "k3s-default" ]; then echo true; else echo false; fi) +K3D := $(shell if [ `which kubectl` <> '' ] && [ "`kubectl config current-context`" = "k3s-default" ]; then echo true; else echo false; fi) # which components to start, useful if you want to disable them to debug COMPONENTS := controller,argo-server LOG_LEVEL := debug From d2585a2fc958affbc5e6bb3ec055f1ba1653de21 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:37:54 -0700 Subject: [PATCH 09/23] fix-3004 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7e51e614de61..14cd58b6b62e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN make argo-server.crt argo-server.key RUN make dist/argo-linux-${IMAGE_ARCH} # RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN ./dist/argo-linux-${IMAGE_ARCH} | grep clean +RUN [sh, -c, './dist/argo-linux-${IMAGE_ARCH} | grep clean'] #################################################################################################### # argoexec From e34879485493094a1e04234c3298607ae18cd09a Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:38:13 -0700 Subject: [PATCH 10/23] fix-3004 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 14cd58b6b62e..363efce64706 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN make argo-server.crt argo-server.key RUN make dist/argo-linux-${IMAGE_ARCH} # RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN [sh, -c, './dist/argo-linux-${IMAGE_ARCH} | grep clean'] +RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} | grep clean"] #################################################################################################### # argoexec From 26718ccf915e20a94addc07c97a5660a4c66c087 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:39:36 -0700 Subject: [PATCH 11/23] sh --- hack/recurl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/recurl.sh b/hack/recurl.sh index cfa5fb9a0fe3..3b88c10532b7 100755 --- a/hack/recurl.sh +++ b/hack/recurl.sh @@ -1,5 +1,5 @@ -#!/bin/bash -set -eux -o pipefail +#!/bin/sh +set -eux file=$1 url=$2 From 6eac62d89161cebb761b15b3dbc61597597709b6 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:45:22 -0700 Subject: [PATCH 12/23] fix-3004 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 363efce64706..e5814d2e67b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,7 +102,7 @@ RUN make argo-server.crt argo-server.key RUN make dist/argo-linux-${IMAGE_ARCH} # RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} | grep clean"] +RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] #################################################################################################### # argoexec From 323b114b9348022d05d6f7b2cb02756512ab4b08 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:49:47 -0700 Subject: [PATCH 13/23] fix-3004 --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e5814d2e67b9..cf737c3d2dd0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,11 +98,11 @@ RUN touch ui/dist/node_modules.marker RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code -RUN make argo-server.crt argo-server.key -RUN make dist/argo-linux-${IMAGE_ARCH} +RUN make status argo-server.crt argo-server.key +RUN make status dist/workflow-controller-linux-${IMAGE_ARCH} status # RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] +RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] #################################################################################################### # argoexec From 52e212e85a512398f05f5cf5d55ed55aeb7589eb Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:52:48 -0700 Subject: [PATCH 14/23] fix-3004 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf737c3d2dd0..880c9040e6c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,10 +99,10 @@ RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code RUN make status argo-server.crt argo-server.key -RUN make status dist/workflow-controller-linux-${IMAGE_ARCH} status +RUN make status dist/argoexec-linux-${IMAGE_ARCH} status # RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} # double check dirtiness -RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] #################################################################################################### # argoexec From 3cff70e59020160f8dae135075812e9514385e66 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 09:53:35 -0700 Subject: [PATCH 15/23] fix-3004 --- Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 880c9040e6c3..cab8be5a6d49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -98,9 +98,12 @@ RUN touch ui/dist/node_modules.marker RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code -RUN make status argo-server.crt argo-server.key -RUN make status dist/argoexec-linux-${IMAGE_ARCH} status -# RUN make dist/argo-linux-${IMAGE_ARCH} dist/workflow-controller-linux-${IMAGE_ARCH} dist/argoexec-linux-${IMAGE_ARCH} +RUN make argo-server.crt argo-server.key +RUN make dist/argoexec-linux-${IMAGE_ARCH} status +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] +RUN make dist/workflow-controller-linux-${IMAGE_ARCH} status +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] +RUN make dist/argo-linux-${IMAGE_ARCH} status # double check dirtiness RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] From 67adc618975d628838fd8850885551bfdc6101a5 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:00:32 -0700 Subject: [PATCH 16/23] fix-3004 --- Dockerfile | 10 +++++----- Makefile | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index cab8be5a6d49..389d5fd0d345 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,13 +99,13 @@ RUN touch ui/dist/app/index.html # fail the build if we are "dirty" RUN git diff --exit-code RUN make argo-server.crt argo-server.key -RUN make dist/argoexec-linux-${IMAGE_ARCH} status -RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] -RUN make dist/workflow-controller-linux-${IMAGE_ARCH} status -RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] +# build order in important - we want to build argoexec last because we use it to check for "dirty", +# because it is the only binary that does not need a Kubernetes cluster to work +RUN make dist/workflow-controller-linux-${IMAGE_ARCH} RUN make dist/argo-linux-${IMAGE_ARCH} status +RUN make dist/argoexec-linux-${IMAGE_ARCH} status # double check dirtiness -RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version | grep clean"] #################################################################################################### # argoexec diff --git a/Makefile b/Makefile index 2f1798644237..cb317e6faff4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ -SHELL=/bin/bash -o pipefail +# must be "sh" for building in Docker +SHELL=/bin/sh -eu OUTPUT_IMAGE_OS ?= linux OUTPUT_IMAGE_ARCH ?= amd64 From 02111cbc981e70d4863a2524bbd313f3982cfcc5 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:04:53 -0700 Subject: [PATCH 17/23] fix-3004 --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 389d5fd0d345..caa9edb9565d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,10 +102,10 @@ RUN make argo-server.crt argo-server.key # build order in important - we want to build argoexec last because we use it to check for "dirty", # because it is the only binary that does not need a Kubernetes cluster to work RUN make dist/workflow-controller-linux-${IMAGE_ARCH} -RUN make dist/argo-linux-${IMAGE_ARCH} status -RUN make dist/argoexec-linux-${IMAGE_ARCH} status -# double check dirtiness -RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version | grep clean"] +RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] +RUN make dist/argo-linux-${IMAGE_ARCH} +RUN make dist/argoexec-linux-${IMAGE_ARCH} +RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] #################################################################################################### # argoexec From 10c25151bc3a5b743c571790361873d96412eeaf Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:08:30 -0700 Subject: [PATCH 18/23] fix-3004 --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index cb317e6faff4..5065fc6bca95 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,4 @@ -# must be "sh" for building in Docker -SHELL=/bin/sh -eu +SHELL=/bin/bash -o pipefail OUTPUT_IMAGE_OS ?= linux OUTPUT_IMAGE_ARCH ?= amd64 @@ -36,7 +35,7 @@ VERSION := latest endif ifneq ($(findstring release,$(GIT_BRANCH)),) -VERSION := $(shell git git tag --points-at=HEAD|grep ^v|head -n1) +VERSION := $(shell git tag --points-at=HEAD|grep ^v|head -n1) endif # MANIFESTS_VERSION is the version to be used for files in manifests and should always be latests unles we are releasing From 6633c60e10f75f86384cc2e9869c006ef55e6a24 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:14:04 -0700 Subject: [PATCH 19/23] fix-3004 --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index caa9edb9565d..63c75a81fb90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -103,9 +103,16 @@ RUN make argo-server.crt argo-server.key # because it is the only binary that does not need a Kubernetes cluster to work RUN make dist/workflow-controller-linux-${IMAGE_ARCH} RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] +RUN git diff --exit-code +RUN git status --porcelain RUN make dist/argo-linux-${IMAGE_ARCH} +RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] +RUN git diff --exit-code +RUN git status --porcelain RUN make dist/argoexec-linux-${IMAGE_ARCH} RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] +RUN git diff --exit-code +RUN git status --porcelain #################################################################################################### # argoexec From 4b43c9c6200e9112d8cc7a90ad43921d85f2ea6b Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:17:06 -0700 Subject: [PATCH 20/23] fix-3004 --- Dockerfile | 8 +++++--- Makefile | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 63c75a81fb90..12007a5366da 100644 --- a/Dockerfile +++ b/Dockerfile @@ -102,17 +102,19 @@ RUN make argo-server.crt argo-server.key # build order in important - we want to build argoexec last because we use it to check for "dirty", # because it is the only binary that does not need a Kubernetes cluster to work RUN make dist/workflow-controller-linux-${IMAGE_ARCH} -RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] RUN git diff --exit-code RUN git status --porcelain +RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] + RUN make dist/argo-linux-${IMAGE_ARCH} -RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] RUN git diff --exit-code RUN git status --porcelain -RUN make dist/argoexec-linux-${IMAGE_ARCH} RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] + +RUN make dist/argoexec-linux-${IMAGE_ARCH} RUN git diff --exit-code RUN git status --porcelain +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] #################################################################################################### # argoexec diff --git a/Makefile b/Makefile index 5065fc6bca95..da374db983ca 100644 --- a/Makefile +++ b/Makefile @@ -120,7 +120,7 @@ endef define docker_build # If we're making a dev build, we build this locally (this will be faster due to existing Go build caches). if [ $(DEV_IMAGE) = true ]; then $(MAKE) dist/$(2)-$(OUTPUT_IMAGE_OS)-$(OUTPUT_IMAGE_ARCH) && mv dist/$(2)-$(OUTPUT_IMAGE_OS)-$(OUTPUT_IMAGE_ARCH) $(2); fi - docker build $(DOCKER_BUILD_OPTS) -t $(IMAGE_NAMESPACE)/$(1):$(VERSION) --target $(1) -f $(DOCKERFILE) --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) . + docker build --progress plain $(DOCKER_BUILD_OPTS) -t $(IMAGE_NAMESPACE)/$(1):$(VERSION) --target $(1) -f $(DOCKERFILE) --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) . if [ $(DEV_IMAGE) = true ]; then mv $(2) dist/$(2)-$(OUTPUT_IMAGE_OS)-$(OUTPUT_IMAGE_ARCH); fi if [ $(K3D) = true ]; then k3d import-images $(IMAGE_NAMESPACE)/$(1):$(VERSION); fi touch $(3) From e067a1e9409f12d999721383900429124823bf49 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:22:27 -0700 Subject: [PATCH 21/23] fix-3004 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index da374db983ca..aa3130022497 100644 --- a/Makefile +++ b/Makefile @@ -160,8 +160,9 @@ else endif $(HOME)/go/bin/staticfiles: - # Install the "staticfiles" tool + $(call backup_go_mod) go get bou.ke/staticfiles + $(call restore_go_mod) server/static/files.go: $(HOME)/go/bin/staticfiles ui/dist/app/index.html # Pack UI into a Go file. From 67094ecc8377e69057b354a8100b43a2e14b7820 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:29:31 -0700 Subject: [PATCH 22/23] fix-3004 --- Dockerfile | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12007a5366da..5aa9d8551b59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -96,25 +96,21 @@ COPY --from=argo-ui dist/app ui/dist/app # stop make from trying to re-build this without yarn installed RUN touch ui/dist/node_modules.marker RUN touch ui/dist/app/index.html -# fail the build if we are "dirty" +# fail the build if we are "dirty" prior to build RUN git diff --exit-code -RUN make argo-server.crt argo-server.key -# build order in important - we want to build argoexec last because we use it to check for "dirty", -# because it is the only binary that does not need a Kubernetes cluster to work -RUN make dist/workflow-controller-linux-${IMAGE_ARCH} +# order is important, must build the CLI first, as building can make the build dirty +RUN make \ + argo-server.crt \ + argo-server.key \ + dist/argo-linux-${IMAGE_ARCH} \ + dist/workflow-controller-linux-${IMAGE_ARCH} \ + dist/argoexec-linux-${IMAGE_ARCH} +# double check "dirty" RUN git diff --exit-code -RUN git status --porcelain -RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version"] - -RUN make dist/argo-linux-${IMAGE_ARCH} -RUN git diff --exit-code -RUN git status --porcelain -RUN ["sh", "-c", "./dist/argo-linux-${IMAGE_ARCH} version"] - -RUN make dist/argoexec-linux-${IMAGE_ARCH} -RUN git diff --exit-code -RUN git status --porcelain -RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version"] +# triple check "dirty" +RUN ["sh", "-c", "./dist/workflow-controller-linux-${IMAGE_ARCH} version | grep clean"] +# we can't check the argo cli, it must have a Kubernetes cluster to work +RUN ["sh", "-c", "./dist/argoexec-linux-${IMAGE_ARCH} version | grep clean"] #################################################################################################### # argoexec From 45d171bf0da16103d6e6ed7c1006b0b293deaca2 Mon Sep 17 00:00:00 2001 From: Alex Collins Date: Tue, 12 May 2020 10:31:33 -0700 Subject: [PATCH 23/23] fix-3004 --- hack/recurl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/recurl.sh b/hack/recurl.sh index 3b88c10532b7..cfa5fb9a0fe3 100755 --- a/hack/recurl.sh +++ b/hack/recurl.sh @@ -1,5 +1,5 @@ -#!/bin/sh -set -eux +#!/bin/bash +set -eux -o pipefail file=$1 url=$2