Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix passing the tag to build-args #33

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
push: false
tags: rancher/hardened-sriov-network-device-plugin:${{ env.TAG }}-amd64
file: Dockerfile
build-args: |
TAG=${{ env.TAG }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/[email protected]
Expand Down Expand Up @@ -68,3 +70,5 @@ jobs:
file: Dockerfile
outputs: type=docker
platforms: linux/arm64
build-args: |
TAG=${{ env.TAG }}
10 changes: 10 additions & 0 deletions .github/workflows/image-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
permissions:
contents: read

env:
GITHUB_ACTION_TAG: ${{ github.ref_name }}

jobs:
push-multiarch:
permissions:
Expand All @@ -15,6 +18,11 @@ jobs:
- name: Check out code
uses: actions/checkout@v4

- name: Set the TAG value
id: get-TAG
run: |
echo "$(make -s log | grep TAG)" >> "$GITHUB_ENV"

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -42,3 +50,5 @@ jobs:
tags: rancher/hardened-sriov-network-device-plugin:${{ github.event.release.tag_name }}
file: Dockerfile
platforms: linux/amd64, linux/arm64
build-args: |
TAG=${{ env.TAG }}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ endif
BUILD_META=-build$(shell date +%Y%m%d)
ORG ?= rancher
# last commit on 2021-10-06
TAG ?= v3.6.2$(BUILD_META)
TAG ?= ${GITHUB_ACTION_TAG}

ifeq ($(TAG),)
TAG := v3.6.2$(BUILD_META)
endif


ifeq (,$(filter %$(BUILD_META),$(TAG)))
$(error TAG $(TAG) needs to end with build metadata: $(BUILD_META))
Expand Down Expand Up @@ -42,7 +47,7 @@ image-scan:
PHONY: log
log:
@echo "ARCH=$(ARCH)"
@echo "TAG=$(TAG)"
@echo "TAG=$(TAG:$(BUILD_META)=)"
@echo "ORG=$(ORG)"
@echo "PKG=$(PKG)"
@echo "SRC=$(SRC)"
Expand Down