mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00

In preparations to get some of the images to hub.docker.com/intel, start using intel/ prefix. Moreover, set the Makefile variables so that the images built by make [images|demos] can easily be pushed to any registry/org by 'docker push' (e.g., by Jenkins). Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
31 lines
649 B
Bash
Executable File
31 lines
649 B
Bash
Executable File
#!/bin/sh -e
|
|
|
|
IMG=$1
|
|
BUILDER=$2
|
|
DIR=$(basename $IMG)
|
|
|
|
if [ -z "$DIR" ]; then
|
|
(>&2 echo "Usage: $0 <image directory>")
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$DIR" ]; then
|
|
(>&2 echo "Directory $DIR doesn't exist")
|
|
exit 1
|
|
fi
|
|
|
|
CWD=`dirname $0`
|
|
TAG=${TAG:-devel}
|
|
SRCREV=$(git rev-parse HEAD)
|
|
|
|
if [ -z "$BUILDER" -o "$BUILDER" = 'docker' ] ; then
|
|
docker build --pull -t ${IMG}:${TAG} "$CWD/$DIR/"
|
|
docker tag ${IMG}:${TAG} ${IMG}:${SRCREV}
|
|
elif [ "$BUILDER" = 'buildah' ] ; then
|
|
buildah bud --pull-always -t ${IMG}:${TAG} "$CWD/$DIR/"
|
|
buildah tag ${IMG}:${TAG} ${IMG}:${SRCREV}
|
|
else
|
|
(>&2 echo "Unknown builder $BUILDER")
|
|
exit 1
|
|
fi
|