2018-01-05 12:19:10 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SELF=`readlink -f "$0"`
|
|
|
|
PUPY=`dirname "$SELF"`
|
|
|
|
PUPY=`readlink -f "$PUPY"`
|
|
|
|
TAG=${TAG:-"latest"}
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2018-03-04 07:03:06 +00:00
|
|
|
DOCKER_REPO=${DOCKER_REPO:-"alxchk"}
|
2018-01-05 12:19:10 +00:00
|
|
|
|
|
|
|
if [ ! -z "$REPO" ]; then
|
|
|
|
if [ "$REPO" == "local" ]; then
|
2018-03-04 07:03:06 +00:00
|
|
|
REPO="pupy"
|
2018-01-05 12:19:10 +00:00
|
|
|
else
|
2018-03-04 07:03:06 +00:00
|
|
|
REPO="$REPO/pupy"
|
2018-01-05 12:19:10 +00:00
|
|
|
fi
|
2018-03-04 07:03:06 +00:00
|
|
|
else
|
|
|
|
REPO="${DOCKER_REPO}/pupy"
|
2018-01-05 12:19:10 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "[+] Build clients"
|
|
|
|
${PUPY}/client/build-docker.sh
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "[+] Build pupysh (${REPO}:${TAG})"
|
2018-10-01 10:53:32 +00:00
|
|
|
cd ${PUPY}/pupy && docker build -f ${PUPY}/pupy/conf/Dockerfile.default -t ${REPO}:${TAG} .
|
2018-01-05 12:19:10 +00:00
|
|
|
echo
|
2018-10-01 19:22:17 +00:00
|
|
|
|
|
|
|
echo "[+] Build pupysh / compose (${REPO}:${TAG})"
|
|
|
|
tmpdir=`mktemp -d`
|
|
|
|
cp ${PUPY}/pupy/requirements.txt ${tmpdir}
|
|
|
|
mkdir -p ${tmpdir}/external
|
|
|
|
cp -a ${PUPY}/pupy/external/pykcp ${tmpdir}/external
|
2018-10-02 04:10:46 +00:00
|
|
|
cp ${PUPY}/pupy/conf/Dockerfile.compose ${tmpdir}
|
|
|
|
docker build -f ${tmpdir}/Dockerfile.compose -t ${REPO}:base-${TAG} ${tmpdir}
|
2018-10-01 19:22:17 +00:00
|
|
|
rm -rf $tmpdir
|
|
|
|
echo
|