summaryrefslogtreecommitdiff
path: root/tools/epfl-publish
blob: 59ae6f138a2ff0ee2a5398ed44b4d763b91a88b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
#
# publishes nightly build if $publish_to is set in environment.
#

[[ $# -eq 1 ]] || {
  cat <<EOM
Usage: $0 <scala version>

Environment variables:
  publish_to   rsync destination
EOM
  exit 0
}
version="$1"

[[ -d dists/archives ]] || {
  echo "Can't find build, has it completed? No directory at dists/archives"
  exit 1
}

# should not be hardcoded
# adds -Dsettings.file= if fixed path is present 
mavenSettingsOption () {
  path="/home/linuxsoft/apps/hudson-maven-settings/settings.xml"
  if [[ -f $path ]]; then
    echo -Dsettings.file="$path"
  fi
}

mavenSettings=${maven_settings:-findMavenSettings}

if [[ -z $publish_to ]]; then
  echo "Nothing to publish."
else
  echo "Publishing nightly build to $publish_to"
  # Archive Scala nightly distribution
  rsync -az dists/archives/ "$publish_to/distributions"
  # don't publish docs in 2.8.x
  [[ $version == "2.8.x" ]] || rsync -az build/scaladoc/ "$publish_to/docs"
  # sbaz
  [[ -d dists/sbaz ]] && rsync -az dists/sbaz/ "$publish_to/sbaz"
  # Deploy the maven artifacts on scala-tools.org
  ( cd dists/maven/latest && ant deploy.snapshot $(mavenSettingsOption) )
fi