William Petit
573715c9d7
Permet de reproduire le comportement de l'actuel serveur d'empaquetage Marang.
28 lines
917 B
Bash
28 lines
917 B
Bash
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
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"
|
|
[ ! -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}
|
|
cp -r /dist/* ./${DEST_DIR} |