Skip to content

Commit

Permalink
build(scorecard): use date for scorecard tag (#489) (#490)
Browse files Browse the repository at this point in the history
* build(scorecard): use date for scorecard tag

* Generate version and patch at build time

(cherry picked from commit 529efd9)

Co-authored-by: Elliott Baron <[email protected]>
  • Loading branch information
mergify[bot] and ebaron authored Nov 15, 2022
1 parent 56f240e commit 3fb1895
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ ENVTEST_K8S_VERSION ?= 1.24

# Scorecard ImagePullPolicy is hardcoded to IfNotPresent
# See: https://github.com/operator-framework/operator-sdk/pull/4762
CUSTOM_SCORECARD_VERSION = $(IMAGE_VERSION)00001
#
# Suffix is the timestamp of the image build, compute with: date -u '+%Y%m%d%H%M%S'
CUSTOM_SCORECARD_VERSION ?= 2.2.0-$(shell date -u '+%Y%m%d%H%M%S')
export CUSTOM_SCORECARD_IMG ?= $(IMAGE_TAG_BASE)-scorecard:$(CUSTOM_SCORECARD_VERSION)

DEPLOY_NAMESPACE ?= cryostat-operator-system
Expand Down Expand Up @@ -194,7 +196,6 @@ manifests: controller-gen
$(CONTROLLER_GEN) rbac:roleName=role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
envsubst < hack/image_tag_patch.yaml.in > config/default/image_tag_patch.yaml
envsubst < hack/image_pull_patch.yaml.in > config/default/image_pull_patch.yaml
envsubst < hack/custom.config.yaml.in > config/scorecard/patches/custom.config.yaml

# Run go fmt against code
.PHONY: fmt
Expand Down Expand Up @@ -347,6 +348,7 @@ custom-scorecard-tests: fmt vet
# Build the custom scorecard OCI image
.PHONY: scorecard-build
scorecard-build: custom-scorecard-tests
envsubst < hack/custom.config.yaml.in > config/scorecard/patches/custom.config.yaml
BUILDAH_FORMAT=docker $(IMAGE_BUILDER) build -t $(CUSTOM_SCORECARD_IMG) \
-f internal/images/custom-scorecard-tests/Dockerfile .

Expand Down
2 changes: 1 addition & 1 deletion bundle/tests/scorecard/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ stages:
- entrypoint:
- cryostat-scorecard-tests
- operator-install
image: quay.io/cryostat/cryostat-operator-scorecard:2.2.0-dev00001
image: quay.io/cryostat/cryostat-operator-scorecard:2.2.0-20221115222145
labels:
suite: cryostat
test: operator-install
Expand Down
2 changes: 1 addition & 1 deletion config/scorecard/patches/custom.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
entrypoint:
- cryostat-scorecard-tests
- operator-install
image: "quay.io/cryostat/cryostat-operator-scorecard:2.2.0-dev00001"
image: "quay.io/cryostat/cryostat-operator-scorecard:2.2.0-20221115222145"
labels:
suite: cryostat
test: operator-install

0 comments on commit 3fb1895

Please sign in to comment.