1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00
Files
quay/build.sh
OpenShift Cherrypick Robot 1d5155103c [redhat-3.14] [Feature] storage: Modify the STS S3 implementation of the storage backend to use Web Identity Tokens when available (PROJQUAY-8576) (#3716)
* Backport the Quay STS token file implementation from https://github.com/quay/quay/pull/3670

* Update build.sh

* Remove trailing white spaces

---------

Co-authored-by: Mathieu Bouchard <mathieu.bouchard@mcn.gouv.qc.ca>
Co-authored-by: Mathieu Bouchard <83231959+bouchardmathieu-qc@users.noreply.github.com>
2025-04-09 09:18:05 -04:00

39 lines
790 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [[ -n "$(git status --porcelain)" ]]; then
echo 'dirty build not supported' >&2
exit 1
fi
# get named head (ex: branch, tag, etc..)
NAME="$( git rev-parse --abbrev-ref HEAD )"
# get 7-character sha
SHA=$( git rev-parse --short HEAD )
# checkout commit so .git/HEAD points to full sha (used in Dockerfile)
git checkout $SHA
REPO=quay.io/quay/quay:$SHA
# Use buildah, podman or docker
if [ -x /usr/bin/buildah ]; then
BUILDER="/usr/bin/buildah bud"
elif [ -x /usr/bin/podman ]; then
BUILDER="/usr/bin/podman build"
elif [ -x /usr/bin/docker ] ; then
BUILDER="/usr/bin/docker build"
fi
if [[ -z "$BUILDER" ]]; then
echo 'Unable to find buildah, podman or docker' >&2
exit 1
fi
echo $BUILDER
$BUILDER -t $REPO .
echo $REPO
git checkout "$NAME"