Commit 003f5693 by Jessica Hawkwell

Adding entrypoint

1 parent e384a4c7
Showing with 39 additions and 0 deletions
#! /bin/bash -eu
set -o pipefail
# Copy files from /usr/share/maven/ref into ${MAVEN_CONFIG}
# So the initial ~/.m2 is set with expected content.
# Don't override, as this is just a reference setup
copy_reference_file() {
local root="${1}"
local f="${2%/}"
local logfile="${3}"
local rel="${f/${root}/}" # path relative to /usr/share/ant/ref/
echo "$f" >> "$logfile"
echo " $f -> $rel" >> "$logfile"
if [[ ! -e ${ANT_CONFIG}/${rel} || $f = *.override ]]
then
echo "copy $rel to ${ANT_CONFIG}" >> "$logfile"
mkdir -p "${ANT_CONFIG}/$(dirname "${rel}")"
cp -r "${f}" "${ANT_CONFIG}/${rel}";
fi;
}
copy_reference_files() {
local log="$ANT_CONFIG/copy_reference_file.log"
if (touch "${log}" > /dev/null 2>&1)
then
echo "--- Copying files at $(date)" >> "$log"
find /usr/share/ant/ref/ -type f -exec bash -eu -c 'copy_reference_file /usr/share/ant/ref/ "$1" "$2"' _ {} "$log" \;
else
echo "Can not write to ${log}. Wrong volume permissions? Carrying on ..."
fi
}
export -f copy_reference_file
copy_reference_files
exec "$@"
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!