Skip to content

Commit

Permalink
Fix permissions setting on test_runs #59
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvanrun committed Oct 29, 2024
1 parent bdfd006 commit f8f54a1
Showing 1 changed file with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ DOCKER_NOOP_VOLUME="${DOCKER_IMAGE_TAG}-volume"
INPUT_DIR="${SCRIPT_DIR}/test/input"
OUTPUT_DIR="${SCRIPT_DIR}/test/output"

echo "=+= (Re)build the container"
source "${SCRIPT_DIR}/do_build.sh" "$DOCKER_IMAGE_TAG"

cleanup() {
echo "=+= Cleaning permissions ..."
# Ensure permissions are set correctly on the output
# This allows the host user (e.g. you) to access and handle these files
docker run --rm \
--quiet \
--volume "$OUTPUT_DIR":/output \
--entrypoint /bin/sh \
$DOCKER_IMAGE_TAG \
-c "chmod -R -f o+rwX /output/* || true"
}


echo "=+= Cleaning up any earlier output"
if [ -d "$OUTPUT_DIR" ]; then
Expand All @@ -27,10 +42,7 @@ else
mkdir -m o+rwx "$OUTPUT_DIR"
fi


echo "=+= (Re)build the container"
source "${SCRIPT_DIR}/do_build.sh" "$DOCKER_IMAGE_TAG"

trap cleanup EXIT

echo "=+= Doing a forward pass"
## Note the extra arguments that are passed here:
Expand Down

0 comments on commit f8f54a1

Please sign in to comment.