Skip to content

Commit

Permalink
fix(build): propagate RELEASE_TAG to buildx container
Browse files Browse the repository at this point in the history
Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai authored and kmova committed Nov 12, 2020
1 parent e79d00f commit c920eb1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 15 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion build/migrate/migrate.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#
FROM golang:1.14.7 as build

ARG RELEASE_TAG
ARG BRANCH
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
Expand All @@ -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/

Expand Down
6 changes: 5 additions & 1 deletion build/upgrade/upgrade.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#
FROM golang:1.14.7 as build

ARG RELEASE_TAG
ARG BRANCH
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT=""
Expand All @@ -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/

Expand Down

0 comments on commit c920eb1

Please sign in to comment.