From c920eb1165c26cb7e8e7f84762156fe498f32534 Mon Sep 17 00:00:00 2001 From: shubham Date: Thu, 12 Nov 2020 18:58:00 +0530 Subject: [PATCH] fix(build): propagate RELEASE_TAG to buildx container Signed-off-by: shubham --- .github/workflows/build.yml | 18 ++++++++++++------ .github/workflows/release.yml | 18 ++++++++++++------ Makefile | 2 +- build/migrate/migrate.Dockerfile | 6 +++++- build/upgrade/upgrade.Dockerfile | 6 +++++- 5 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 350f5f72..fb068f19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,10 +45,13 @@ jobs: if [ ${BRANCH} = "master" ]; then CI_TAG="ci" fi - echo "::set-env name=TAG::${CI_TAG}" - echo "::set-env name=BRANCH::${BRANCH}" + echo "TAG=${CI_TAG}" >> $GITHUB_ENV + echo "BRANCH=${BRANCH}" >> $GITHUB_ENV + + - name: Print Tag info + run: | echo "BRANCH: ${BRANCH}" - echo "TAG: ${CI_TAG}" + echo "TAG: ${TAG}" - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -88,10 +91,13 @@ jobs: if [ ${BRANCH} = "master" ]; then CI_TAG="ci" fi - echo "::set-env name=TAG::${CI_TAG}" - echo "::set-env name=BRANCH::${BRANCH}" + echo "TAG=${CI_TAG}" >> $GITHUB_ENV + echo "BRANCH=${BRANCH}" >> $GITHUB_ENV + + - name: Print Tag info + run: | echo "BRANCH: ${BRANCH}" - echo "TAG: ${CI_TAG}" + echo "TAG: ${TAG}" - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 621f12b8..0e0487a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,9 +28,12 @@ jobs: - name: Set Tag run: | TAG="${GITHUB_REF#refs/*/v}" - echo "::set-env name=TAG::${TAG}" - echo "::set-env name=RELEASE_TAG::${TAG}" - echo "RELEASE_TAG ${TAG}" + echo "TAG=${TAG}" >> $GITHUB_ENV + echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV + + - name: Print Tag info + run: | + echo "RELEASE TAG: ${RELEASE_TAG}" - name: Set up QEMU uses: docker/setup-qemu-action@v1 @@ -65,9 +68,12 @@ jobs: - name: Set Tag run: | TAG="${GITHUB_REF#refs/*/v}" - echo "::set-env name=TAG::${TAG}" - echo "::set-env name=RELEASE_TAG::${TAG}" - echo "RELEASE_TAG ${TAG}" + echo "TAG=${TAG}" >> $GITHUB_ENV + echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV + + - name: Print Tag info + run: | + echo "RELEASE TAG: ${RELEASE_TAG}" - name: Set up QEMU uses: docker/setup-qemu-action@v1 diff --git a/Makefile b/Makefile index 3ec0fa67..79edb440 100644 --- a/Makefile +++ b/Makefile @@ -51,7 +51,7 @@ export XC_ARCH ARCH:=${XC_OS}_${XC_ARCH} export ARCH -export DBUILD_ARGS=--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REPO_URL=${DBUILD_REPO_URL} --build-arg DBUILD_SITE_URL=${DBUILD_SITE_URL} +export DBUILD_ARGS=--build-arg DBUILD_DATE=${DBUILD_DATE} --build-arg DBUILD_REPO_URL=${DBUILD_REPO_URL} --build-arg DBUILD_SITE_URL=${DBUILD_SITE_URL} --build-arg RELEASE_TAG=${RELEASE_TAG} --build-arg BRANCH=${BRANCH} # Specify the name for the binaries UPGRADE=upgrade diff --git a/build/migrate/migrate.Dockerfile b/build/migrate/migrate.Dockerfile index d4f94689..68860007 100644 --- a/build/migrate/migrate.Dockerfile +++ b/build/migrate/migrate.Dockerfile @@ -16,6 +16,8 @@ # FROM golang:1.14.7 as build +ARG RELEASE_TAG +ARG BRANCH ARG TARGETOS ARG TARGETARCH ARG TARGETVARIANT="" @@ -25,7 +27,9 @@ ENV GO111MODULE=on \ GOARCH=${TARGETARCH} \ GOARM=${TARGETVARIANT} \ DEBIAN_FRONTEND=noninteractive \ - PATH="/root/go/bin:${PATH}" + PATH="/root/go/bin:${PATH}" \ + RELEASE_TAG=${RELEASE_TAG} \ + BRANCH=${BRANCH} WORKDIR /go/src/github.com/openebs/upgrade/ diff --git a/build/upgrade/upgrade.Dockerfile b/build/upgrade/upgrade.Dockerfile index 09e8cb91..2f58cabb 100644 --- a/build/upgrade/upgrade.Dockerfile +++ b/build/upgrade/upgrade.Dockerfile @@ -16,6 +16,8 @@ # FROM golang:1.14.7 as build +ARG RELEASE_TAG +ARG BRANCH ARG TARGETOS ARG TARGETARCH ARG TARGETVARIANT="" @@ -25,7 +27,9 @@ ENV GO111MODULE=on \ GOARCH=${TARGETARCH} \ GOARM=${TARGETVARIANT} \ DEBIAN_FRONTEND=noninteractive \ - PATH="/root/go/bin:${PATH}" + PATH="/root/go/bin:${PATH}" \ + RELEASE_TAG=${RELEASE_TAG} \ + BRANCH=${BRANCH} WORKDIR /go/src/github.com/openebs/upgrade/