From a5ffb653dfe45f8723c4c5d457c11e98818c938e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Thu, 1 Apr 2021 19:18:36 +0200 Subject: [PATCH] chore(ci): fix default branch in Dockerfiles (#875) --- build.sh | 4 ++-- dockerfiles/Dockerfile.dev-self-contained | 6 +++--- dockerfiles/Dockerfile.self-contained | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 363dc74..47d2b5c 100644 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=$(git describe) +VERSION=$(git describe --tags) echo "Building $VERSION..." -go build -o watchtower -ldflags "-X github.com/containrrr/watchtower/cmd.version=$VERSION" \ No newline at end of file +go build -o watchtower -ldflags "-X github.com/containrrr/watchtower/cmd.version=$VERSION" diff --git a/dockerfiles/Dockerfile.dev-self-contained b/dockerfiles/Dockerfile.dev-self-contained index 307ffbe..b22ef13 100644 --- a/dockerfiles/Dockerfile.dev-self-contained +++ b/dockerfiles/Dockerfile.dev-self-contained @@ -4,8 +4,8 @@ FROM golang:alpine as builder -# use version (for example "v0.3.3") or "master" -ARG WATCHTOWER_VERSION=master +# use version (for example "v0.3.3") or "main" +ARG WATCHTOWER_VERSION=main RUN apk add --no-cache \ alpine-sdk \ @@ -18,7 +18,7 @@ COPY . /watchtower RUN \ cd /watchtower && \ \ - GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . && \ + GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-extldflags '-static' -X github.com/containrrr/watchtower/cmd.version=$(git describe --tags)" . && \ GO111MODULE=on go test ./... -v diff --git a/dockerfiles/Dockerfile.self-contained b/dockerfiles/Dockerfile.self-contained index 64d5dc0..f24701f 100644 --- a/dockerfiles/Dockerfile.self-contained +++ b/dockerfiles/Dockerfile.self-contained @@ -4,8 +4,8 @@ FROM golang:alpine as builder -# use version (for example "v0.3.3") or "master" -ARG WATCHTOWER_VERSION=master +# use version (for example "v0.3.3") or "main" +ARG WATCHTOWER_VERSION=main RUN apk add --no-cache \ alpine-sdk \ @@ -18,7 +18,7 @@ RUN git clone --branch "${WATCHTOWER_VERSION}" https://github.com/containrrr/wat RUN \ cd watchtower && \ \ - GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . && \ + GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-extldflags '-static' -X github.com/containrrr/watchtower/cmd.version=$(git describe --tags)" . && \ GO111MODULE=on go test ./... -v