2019-01-24 17:39:18 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-03-27 11:50:44 +01:00
|
|
|
set -xe
|
2019-01-24 17:39:18 +01:00
|
|
|
|
|
|
|
cp -r . /src
|
|
|
|
|
|
|
|
CONTAINER_ID=${HOSTNAME}
|
|
|
|
ENV_FILE=$(mktemp)
|
|
|
|
DOCKER_ARGS="run --rm --env-file='${ENV_FILE}' --volumes-from ${CONTAINER_ID} [IMAGE_TAG] /usr/bin/python3 /tamarin/lib/build.py [PROFILE] [ARCH]"
|
|
|
|
|
|
|
|
# Forward proxy environment
|
|
|
|
cat > "${ENV_FILE}" <<EOF
|
|
|
|
HTTP_PROXY=${HTTP_PROXY}
|
|
|
|
HTTPS_PROXY=${HTTPS_PROXY}
|
|
|
|
http_proxy=${http_proxy}
|
|
|
|
https_proxy=${https_proxy}
|
|
|
|
EOF
|
|
|
|
|
|
|
|
[ "${TAMARIN_FORCE_REBUILD}" == "true" ] && PACKAGE_ARGS="${PACKAGE_ARGS} --rebuild"
|
2020-03-27 11:50:44 +01:00
|
|
|
[ "${TAMARIN_PREPARE_ONLY}" == "true" ] && PACKAGE_ARGS="${PACKAGE_ARGS} --prepare-only"
|
2019-01-24 17:39:18 +01:00
|
|
|
[ ! -z "${TAMARIN_PACKAGE_ARCH}" ] && PACKAGE_ARGS="${PACKAGE_ARGS} -a ${TAMARIN_PACKAGE_ARCH}"
|
|
|
|
[ ! -z "${TAMARIN_BASE_IMAGE}" ] && PACKAGE_ARGS="${PACKAGE_ARGS} -b ${TAMARIN_BASE_IMAGE}"
|
|
|
|
[ ! -z "${TAMARIN_PROFILE}" ] && PACKAGE_ARGS="${PACKAGE_ARGS} -p ${TAMARIN_PROFILE}"
|
|
|
|
|
|
|
|
/tamarin/package . ${PACKAGE_ARGS} --override-docker-args="${DOCKER_ARGS}"
|
|
|
|
|
|
|
|
DEST_DIR=${TAMARIN_DEST_DIR:-dist}
|
|
|
|
mkdir -p ${DEST_DIR}
|
2020-03-27 11:50:44 +01:00
|
|
|
for f in /dist/*; do
|
2020-03-30 11:35:08 +02:00
|
|
|
if [ -e "$f" ]; then
|
|
|
|
cp "$f" ./${DEST_DIR}
|
|
|
|
fi
|
2020-03-27 11:50:44 +01:00
|
|
|
done
|