pull/365/merge
samtygier 2020-07-14 10:34:09 +02:00 committed by GitHub
commit a79ebc53d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -73,11 +73,26 @@ fi
# Modify original build-options to allow config file to be mounted in the docker container
BUILD_OPTS="$(echo "${BUILD_OPTS:-}" | sed -E 's@\-c\s?([^ ]+)@-c /config@')"
STAGE_LIST_VOLUMES=""
STAGE_LIST_DOCKER=""
for STAGE in $STAGE_LIST
do
echo stage: $STAGE
if [[ $STAGE = /* || $STAGE = ../* ]] ; then
STAGE_LIST_VOLUMES="${STAGE_LIST_VOLUMES} --volume `realpath $STAGE`:/ext-stages/`basename $STAGE`:ro"
STAGE_LIST_DOCKER="${STAGE_LIST_DOCKER} /ext-stages/`basename $STAGE`"
else
STAGE_LIST_DOCKER="${STAGE_LIST_DOCKER} $STAGE"
fi
done
${DOCKER} build -t pi-gen "${DIR}"
if [ "${CONTAINER_EXISTS}" != "" ]; then
trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}_cont' SIGINT SIGTERM
time ${DOCKER} run --rm --privileged \
--volume "${CONFIG_FILE}":/config:ro \
${STAGE_LIST_VOLUMES} \
-e "STAGE_LIST_DOCKER=${STAGE_LIST_DOCKER}" \
-e "GIT_HASH=${GIT_HASH}" \
--volumes-from="${CONTAINER_NAME}" --name "${CONTAINER_NAME}_cont" \
pi-gen \
@ -89,6 +104,8 @@ else
trap 'echo "got CTRL+C... please wait 5s" && ${DOCKER} stop -t 5 ${CONTAINER_NAME}' SIGINT SIGTERM
time ${DOCKER} run --name "${CONTAINER_NAME}" --privileged \
--volume "${CONFIG_FILE}":/config:ro \
${STAGE_LIST_VOLUMES} \
-e "STAGE_LIST_DOCKER=${STAGE_LIST_DOCKER}" \
-e "GIT_HASH=${GIT_HASH}" \
pi-gen \
bash -e -o pipefail -c "dpkg-reconfigure qemu-user-static &&

View File

@ -229,6 +229,10 @@ fi
mkdir -p "${WORK_DIR}"
log "Begin ${BASE_DIR}"
if [ -v STAGE_LIST_DOCKER ]; then
STAGE_LIST=${STAGE_LIST_DOCKER}
fi
STAGE_LIST=${STAGE_LIST:-${BASE_DIR}/stage*}
for STAGE_DIR in $STAGE_LIST; do