simdem/scripts/build.sh

42 строки
942 B
Bash
Исходник Обычный вид История

#!/bin/bash
# Builds a SimDem container.
#
# Usage:
#
# build.sh - builds both containers (cli and novnc)
# build.sh novnc - builds the novnc version of the container
# build.sh cli - builds the CLI version of the container
REPOSITORY=rgardler
FLAVOR=${1:-}
IMAGE_NAME_PREFIX=simdem_
2017-08-08 00:26:56 +03:00
VERSION=`grep SIMDEM_VERSION config.py | awk '{print $3}' | tr -d '"'`
build_container() {
docker build -f Dockerfile_$1 -t $REPOSITORY/${IMAGE_NAME_PREFIX}$1:$VERSION .
if [ $? -eq 0 ]; then
echo "Built $REPOSITORY/${IMAGE_NAME_PREFIX}$1:$VERSION"
2017-07-03 08:48:59 +03:00
else
echo "Failed to build $REPOSITORY/${IMAGE_NAME_PREFIX}$1:$VERSION"
return 0
2017-07-03 08:48:59 +03:00
fi
}
if [[ $FLAVOR == "novnc" ]]; then
build_container novnc
elif [[ $FLAVOR == "cli" ]]; then
build_container cli
else
build_container cli
if [ $? -ne 0 ]; then
echo "Building container failed. Exiting"
return 1
fi
build_container novnc
fi
2017-08-08 20:05:10 +03:00
exit $?