33 lines
1.0 KiB
Bash
33 lines
1.0 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
set -xe
|
|
|
|
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"
|
|
[ "${TAMARIN_PREPARE_ONLY}" == "true" ] && PACKAGE_ARGS="${PACKAGE_ARGS} --prepare-only"
|
|
[ ! -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}
|
|
for f in /dist/*; do
|
|
if [ -e "$f" ]; then
|
|
cp "$f" ./${DEST_DIR}
|
|
fi
|
|
done |