2018-01-05 12:19:10 +00:00
|
|
|
#!/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"}
|
2018-01-05 12:19:10 +00:00
|
|
|
|
|
|
|
if [ ! -z "$REPO" ]; then
|
|
|
|
if [ "$REPO" == "local" ]; then
|
2018-03-03 20:51:44 +00:00
|
|
|
REPO=""
|
2018-01-05 12:19:10 +00:00
|
|
|
else
|
2018-03-04 07:03:06 +00:00
|
|
|
REPO="$REPO/"
|
2018-01-05 12:19:10 +00:00
|
|
|
fi
|
2018-03-04 07:03:06 +00:00
|
|
|
else
|
|
|
|
REPO="${DOCKER_REPO}/"
|
2018-01-05 12:19:10 +00:00
|
|
|
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
|
2019-07-11 15:58:33 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2018-01-13 09:10:21 +00:00
|
|
|
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
|