Skip to content

Commit 23b8216

Browse files
committed
Merge branch 'common-build-script' into 2.8.x
2 parents 4135416 + 56536de commit 23b8216

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tools/epfl-publish

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# publishes nightly build if $publish_to is set in environment.
4+
# alternate maven settings.xml file given in $maven_settings.
45
#
56

67
[[ $# -eq 1 ]] || {
@@ -20,7 +21,19 @@ version="$1"
2021
}
2122

2223
# should not be hardcoded
23-
mavenSettings="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
24+
# adds -Dsettings.file= if fixed path is present
25+
mavenSettingsOption () {
26+
hardcoded_path="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
27+
28+
# environment variable
29+
if [[ -n $maven_settings ]]; then
30+
echo -Dsettings.file="$maven_settings"
31+
elif [[ -f $hardcoded_path ]]; then
32+
echo -Dsettings.file="$hardcoded_path"
33+
fi
34+
}
35+
36+
mavenSettings=${maven_settings:-findMavenSettings}
2437

2538
if [[ -z $publish_to ]]; then
2639
echo "Nothing to publish."
@@ -33,5 +46,5 @@ else
3346
# sbaz
3447
[[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz"
3548
# Deploy the maven artifacts on scala-tools.org
36-
( cd dists/maven/latest && ant deploy.snapshot -Dsettings.file="$mavenSettings" )
49+
( cd dists/maven/latest && ant deploy.snapshot $(mavenSettingsOption) )
3750
fi

0 commit comments

Comments
 (0)