Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permissions on bash scripts #62

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# sh (and their template counter parts) should always be lf their line endings
*.sh text=lf eol=lf
*.sh.j2 text=lf eol=lf
resources/* filter=lfs diff=lfs merge=lfs -text
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
Loading