Skip to content

Commit 59348d0

Browse files
committed
Boiling more logic out of jenkins.
Offer explicit settings.xml path for maven if some specific hardcoded path exists, don't otherwise. At least it's in one place where we can keep an eye on it.
1 parent 9c15462 commit 59348d0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tools/epfl-publish

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,15 @@ version="$1"
2020
}
2121

2222
# should not be hardcoded
23-
mavenSettings="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
23+
# adds -Dsettings.file= if fixed path is present
24+
mavenSettingsOption () {
25+
path="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
26+
if [[ -f $path ]]; then
27+
echo -Dsettings.file="$path"
28+
fi
29+
}
30+
31+
mavenSettings=${maven_settings:-findMavenSettings}
2432

2533
if [[ -z $publish_to ]]; then
2634
echo "Nothing to publish."
@@ -33,5 +41,5 @@ else
3341
# sbaz
3442
[[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz"
3543
# Deploy the maven artifacts on scala-tools.org
36-
( cd dists/maven/latest && ant deploy.snapshot -Dsettings.file="$mavenSettings" )
44+
( cd dists/maven/latest && ant deploy.snapshot $(mavenSettingsOption) )
3745
fi

0 commit comments

Comments
 (0)