Skip to content

Commit

Permalink
fix: environment configuration for mintmaker in preview mode
Browse files Browse the repository at this point in the history
mintmaker/development/kustomization.yaml accumulates both
konflux-ci/mintmaker/config/default and
konflux-ci/mintmaker/config/renovate. The original code results in the
config/renovate is lost and config/default is accumulated twice
incorrectly.
  • Loading branch information
tkdchen committed Jan 22, 2025
1 parent caeb3ce commit 5f14cc8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion hack/preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,16 @@ sed -i.bak "s/rekor-server.enterprise-contract-service.svc/$rekor_server/" $ROOT

[ -n "${MINTMAKER_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/mintmaker\")) |=.newName=\"${MINTMAKER_IMAGE_REPO}\"" $ROOT/components/mintmaker/development/kustomization.yaml
[ -n "${MINTMAKER_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/mintmaker\")) |=.newTag=\"${MINTMAKER_IMAGE_TAG}\"" $ROOT/components/mintmaker/development/kustomization.yaml
[[ -n "${MINTMAKER_PR_OWNER}" && "${MINTMAKER_PR_SHA}" ]] && yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/mintmaker*\")) |= \"https://github.com/${MINTMAKER_PR_OWNER}/mintmaker/config/default?ref=${MINTMAKER_PR_SHA}\"" $ROOT/components/mintmaker/development/kustomization.yaml

if [[ -n "${MINTMAKER_PR_OWNER}" && "${MINTMAKER_PR_SHA}" ]]
then
yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/mintmaker/config/default*\")) |=
\"https://github.com/${MINTMAKER_PR_OWNER}/mintmaker/config/default?ref=${MINTMAKER_PR_SHA}\"
" $ROOT/components/mintmaker/development/kustomization.yaml
yq -i e "(.resources[] | select(. ==\"*github.com/konflux-ci/mintmaker/config/renovate*\")) |=
\"https://github.com/${MINTMAKER_PR_OWNER}/mintmaker/config/renovate?ref=${MINTMAKER_PR_SHA}\"
" $ROOT/components/mintmaker/development/kustomization.yaml
fi

[ -n "${IMAGE_CONTROLLER_IMAGE_REPO}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/image-controller\")) |=.newName=\"${IMAGE_CONTROLLER_IMAGE_REPO}\"" $ROOT/components/image-controller/development/kustomization.yaml
[ -n "${IMAGE_CONTROLLER_IMAGE_TAG}" ] && yq -i e "(.images.[] | select(.name==\"quay.io/konflux-ci/image-controller\")) |=.newTag=\"${IMAGE_CONTROLLER_IMAGE_TAG}\"" $ROOT/components/image-controller/development/kustomization.yaml
Expand Down

0 comments on commit 5f14cc8

Please sign in to comment.