Skip to content

Commit

Permalink
cicd: tweak login behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Jul 23, 2024
1 parent 95f5a5f commit dbcfe30
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contrib/openshift/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ cleanup() {
rm "${cidfile}" || echo Unable to remove cidfile: "${cidfile}" >&2
fi
}
if ! skopeo login --get-login "${REGISTRY}" >/dev/null; then
[[ -n "${QUAY_USER-}" && -n "${QUAY_TOKEN-}" ]] &&
skopeo login -u="${QUAY_USER}" -p="${QUAY_TOKEN}" "${REGISTRY}"

# Unconditionally log in if we have credentials because AppSRE CI can't be
# bothered to clear them between Jenkins jobs.
if [[ -n "${QUAY_USER-}" && -n "${QUAY_TOKEN-}" ]]; then
skopeo login -u="${QUAY_USER}" -p="${QUAY_TOKEN}" "${REGISTRY}"
fi
${CONTAINER_ENGINE} run \
--cidfile "${cidfile}" \
Expand Down

0 comments on commit dbcfe30

Please sign in to comment.