Skip to content

Commit

Permalink
fix: Print correct version string. (argoproj#2713)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec authored Apr 16, 2020
1 parent e9589d2 commit cef6dfb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ 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"
RUN git diff --exit-code
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 \
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ WORKDIR /tmp
# Install docker
ENV DOCKER_CHANNEL stable
ENV DOCKER_VERSION 18.09.1

RUN if [ "${IMAGE_OS}" = "linux" -a "${IMAGE_ARCH}" = "amd64" ]; then \
wget -O docker.tgz https://download.docker.com/linux/static/${DOCKER_CHANNEL}/x86_64/docker-${DOCKER_VERSION}.tgz; \
elif [ "${IMAGE_OS}" = "linux" -a "${IMAGE_ARCH}" = "arm64" ]; then \
Expand Down Expand Up @@ -61,7 +62,7 @@ ARG IMAGE_ARCH=amd64
ENV KUBECTL_VERSION=1.15.1
ENV JQ_VERSION=1.6
RUN apt-get update && \
apt-get --no-install-recommends install -y curl ca-certificates apt-utils apt-transport-https procps git tar mime-support && \
apt-get --no-install-recommends install -y curl procps git apt-utils apt-transport-https ca-certificates tar mime-support && \
apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
Expand Down
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ GIT_TREE_STATE = $(shell if [ -z "`git status --porcelain`" ]; then echo

export DOCKER_BUILDKIT = 1

# To allow you to build with cache for debugging purposes.
DOCKER_BUILDS_OPTS := --no-cache

# docker image publishing options
IMAGE_NAMESPACE ?= argoproj

Expand Down Expand Up @@ -171,7 +174,7 @@ ifeq ($(DEV_IMAGE),true)
docker build -t $(IMAGE_NAMESPACE)/argocli:$(VERSION) --target argocli -f Dockerfile.dev --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
rm -f argo
else
docker build --no-cache -t $(IMAGE_NAMESPACE)/argocli:$(VERSION) --target argocli --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
docker build $(DOCKER_BUILD_OPTS) -t $(IMAGE_NAMESPACE)/argocli:$(VERSION) --target argocli --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
endif
ifeq ($(K3D),true)
k3d import-images $(IMAGE_NAMESPACE)/argocli:$(VERSION)
Expand Down Expand Up @@ -199,7 +202,7 @@ ifeq ($(DEV_IMAGE),true)
docker build -t $(IMAGE_NAMESPACE)/workflow-controller:$(VERSION) --target workflow-controller -f Dockerfile.dev --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
rm -f workflow-controller
else
docker build --no-cache -t $(IMAGE_NAMESPACE)/workflow-controller:$(VERSION) --target workflow-controller --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
docker build $(DOCKER_BUILD_OPTS) -t $(IMAGE_NAMESPACE)/workflow-controller:$(VERSION) --target workflow-controller --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
endif
ifeq ($(K3D),true)
k3d import-images $(IMAGE_NAMESPACE)/workflow-controller:$(VERSION)
Expand All @@ -224,7 +227,7 @@ ifeq ($(DEV_IMAGE),true)
docker build -t $(IMAGE_NAMESPACE)/argoexec:$(VERSION) --target argoexec -f Dockerfile.dev --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
rm -f argoexec
else
docker build --no-cache -t $(IMAGE_NAMESPACE)/argoexec:$(VERSION) --target argoexec --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
docker build $(DOCKER_BUILD_OPTS) -t $(IMAGE_NAMESPACE)/argoexec:$(VERSION) --target argoexec --build-arg IMAGE_OS=$(OUTPUT_IMAGE_OS) --build-arg IMAGE_ARCH=$(OUTPUT_IMAGE_ARCH) .
endif
ifeq ($(K3D),true)
k3d import-images $(IMAGE_NAMESPACE)/argoexec:$(VERSION)
Expand Down
Binary file removed assets/Argo_UI_2.1.gif
Binary file not shown.
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// Version information set by link flags during build. We fall back to these sane
// default values when we build outside the Makefile context (e.g. go build or go test).
var (
version = "0.0.0" // value from VERSION file
version = "v0.0.0" // value from VERSION file
buildDate = "1970-01-01T00:00:00Z" // output from `date -u +'%Y-%m-%dT%H:%M:%SZ'`
gitCommit = "" // output from `git rev-parse HEAD`
gitTag = "" // output from `git describe --exact-match --tags HEAD` (if clean tree state)
Expand Down Expand Up @@ -41,7 +41,7 @@ func GetVersion() Version {
} else {
// otherwise formulate a version string based on as much metadata
// information we have available.
versionStr = "v" + version
versionStr = version
if len(gitCommit) >= 7 {
versionStr += "+" + gitCommit[0:7]
if gitTreeState != "clean" {
Expand Down

0 comments on commit cef6dfb

Please sign in to comment.