Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
DockerHelper
/
ant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Registry
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 003f5693
authored
Jun 04, 2017
by
Jessica Hawkwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding entrypoint
1 parent
e384a4c7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
ant-entrypoint.sh
ant-entrypoint.sh
0 → 100644
View file @
003f569
#! /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
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment