pupy/client/build-docker.sh

58 lines
1.1 KiB
Bash
Raw Normal View History

#!/bin/bash
SELF=`readlink -f "$0"`
PUPY=`dirname "$SELF"`/../
PUPY=`readlink -f "$PUPY"`
2018-03-03 20:51:44 +00:00
DOCKER_REPO=${DOCKER_REPO:-"alxchk"}
2018-01-11 15:00:53 +00:00
CLEAN=${CLEAN:-"no"}
if [ ! -z "$REPO" ]; then
if [ "$REPO" == "local" ]; then
2018-03-03 20:51:44 +00:00
REPO=""
else
2018-03-04 07:03:06 +00:00
REPO="$REPO/"
fi
2018-03-04 07:03:06 +00:00
else
REPO="${DOCKER_REPO}/"
fi
echo $PUPY
set -e
2018-01-11 15:00:53 +00:00
start_container() {
TOOLCHAIN="tc-$1"
CONTAINER_NAME="build-pupy-$1"
SOURCES="$2"
SCRIPT="client/$SOURCES/build-docker.sh"
(
echo
echo "[+] Build $SOURCES with toolchain ${REPO}$TOOLCHAIN"
NEW=""
docker container inspect ${CONTAINER_NAME} >/dev/null 2>/dev/null || NEW=1
if [ ! -z "$NEW" ]; then
mkdir -p /tmp/pupy-build/${REPO}${TOOLCHAIN}
2018-01-11 15:00:53 +00:00
docker run --name ${CONTAINER_NAME} \
-v ${PUPY}:/build/workspace/project ${REPO}${TOOLCHAIN} ${SCRIPT}
else
docker start -ai ${CONTAINER_NAME}
fi
if [ "$CLEAN" == "yes" ]; then
docker rm ${CONTAINER_NAME}
fi
echo
)
}
if [ ! -z "$1" ] && [ ! -z "$2" ]; then
start_container $1 $2
else
start_container windows sources
start_container linux32 sources-linux
start_container linux64 sources-linux
start_container android android_sources
fi