From 7f5cfc8b13cf76c2e21ec64888c7363e8fa44c10 Mon Sep 17 00:00:00 2001 From: Bill Maxwell Date: Fri, 5 Jan 2018 12:11:18 -0700 Subject: [PATCH] Pass tag to dapper container Drone does a git clone with `--no-tags` so the normal version script does not work. --- Dockerfile.dapper | 2 +- scripts/version | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.dapper b/Dockerfile.dapper index 26ec8549..7bf06aea 100644 --- a/Dockerfile.dapper +++ b/Dockerfile.dapper @@ -24,7 +24,7 @@ ENV DAPPER_SOURCE /go/src/github.com/rancher/rke/ ENV DAPPER_RUN_ARGS --privileged -v /var/lib/docker ENV DAPPER_OUTPUT ./bin ./dist ./build/bin ENV DAPPER_DOCKER_SOCKET true -ENV DAPPER_ENV TAG REPO GOOS CROSS +ENV DAPPER_ENV TAG REPO GOOS CROSS DRONE_TAG ENV TRASH_CACHE ${DAPPER_SOURCE}/.trash-cache ENV HOME ${DAPPER_SOURCE} WORKDIR ${DAPPER_SOURCE} diff --git a/scripts/version b/scripts/version index c52f0f7e..87d180fc 100755 --- a/scripts/version +++ b/scripts/version @@ -5,7 +5,7 @@ if [ -n "$(git status --porcelain --untracked-files=no)" ]; then fi COMMIT=$(git rev-parse --short HEAD) -GIT_TAG=$(git tag -l --contains HEAD | head -n 1) +GIT_TAG=${DRONE_TAG:-$(git tag -l --contains HEAD | head -n 1)} if [[ -z "$DIRTY" && -n "$GIT_TAG" ]]; then VERSION=$GIT_TAG