Jenkins/resources/com/cadoles/tamarin/run-tamarin.sh

33 lines
1.0 KiB
Bash
Raw Normal View History

#!/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
2020-03-30 11:35:08 +02:00
if [ -e "$f" ]; then
cp "$f" ./${DEST_DIR}
fi
done