Skip to content

Commit

Permalink
Fix scaladoc deployment to latest folder on master branch merges (#3104)
Browse files Browse the repository at this point in the history
* Fix scaladocs 'latest' deployment

...to geotrellis/scaladocs.

Core issue was that the `on` matcher
was failing because we removed oraclejdk
in 389cda4#diff-354f30a63fb0907d4ad57269548329e3

We were also missing the autoAPIMappings
in build.sbt and there were some file
permissions issues with running the git
checkout within the geotrellis repo.
Permissions issues were resolved by checking
the scaladocs repo out to a different
directory, configurable in the script.

* Fix docker volume permissions issues

* Run scaladoc in separate RUN_SET

To avoid build runtime limits
  • Loading branch information
CloudNiner authored and echeipesh committed Oct 14, 2019
1 parent 9c6f23a commit f1e1073
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Expand Up @@ -11,6 +11,7 @@ env:
- RUN_SET=1
- RUN_SET=2
- RUN_SET=3
- RUN_SET=scaladoc

language: scala

Expand Down Expand Up @@ -61,6 +62,7 @@ notifications:

before_deploy:
- export GEOTRELLIS_VERSION_SUFFIX="-${TRAVIS_COMMIT:0:7}"
- ./sbt unidoc

deploy:
- provider: script
Expand All @@ -69,5 +71,6 @@ deploy:
on:
repo: locationtech/geotrellis
branch: master
jdk: oraclejdk8
condition: "$RUN_SET = 'scaladoc'"
jdk: openjdk8
scala: "2.11.12"
4 changes: 3 additions & 1 deletion .travis/build-and-test.sh
Expand Up @@ -14,11 +14,13 @@ elif [ $RUN_SET = "2" ]; then
else
.travis/build-set-2.sh;
fi
else
elif [ $RUN_SET = "3" ]; then
echo "RUNNING SET 3";
if [ `echo $TRAVIS_SCALA_VERSION | cut -f1-2 -d "."` = "2.11" ]; then
.travis/build-and-test-set-3.sh;
else
.travis/build-set-3.sh;
fi
else
echo "Skipping RUN_SET = $RUN_SET in build-and-test.sh."
fi
24 changes: 14 additions & 10 deletions .travis/scaladocs.sh
Expand Up @@ -8,23 +8,27 @@ then
exit 0
fi

rev=$(git rev-parse --short HEAD)
DIR="$(dirname "$0")/.."
SCALADOCS_CHECKOUT_DIR="${1:-/tmp}/scaladocs"
SCALADOCS_REPO="https://github.com/geotrellis/scaladocs.git"
SCALADOCS_BRANCH="gh-pages"

# Build docs
./sbt "++$TRAVIS_SCALA_VERSION" unidoc
pushd "$DIR"
rev=$(git rev-parse --short HEAD)

# Set up git
git config --global user.email "azaveadev@azavea.com"
git config --global user.name "azaveaci"

# Inside scaladocs from hereon
rm -rf scaladocs
git clone https://github.com/geotrellis/scaladocs.git
rm -rf scaladocs/latest
mv target/scala-2.11/unidoc scaladocs/latest
cd scaladocs
rm -rf "$SCALADOCS_CHECKOUT_DIR"
git clone "$SCALADOCS_REPO" "$SCALADOCS_CHECKOUT_DIR"
rm -rf "$SCALADOCS_CHECKOUT_DIR/latest"
mv "target/scala-2.11/unidoc" "$SCALADOCS_CHECKOUT_DIR/latest"

pushd "$SCALADOCS_CHECKOUT_DIR"
git remote add originAuth https://$CI_GH_TOKEN@github.com/geotrellis/scaladocs.git

echo "Pushing scaladoc to $SCALADOCS_REPO#$SCALADOCS_BRANCH"
git add -A .
git commit -m "rebuild scaladocs at ${rev}"
git push -q originAuth gh-pages
git push -q originAuth "$SCALADOCS_BRANCH"
1 change: 1 addition & 0 deletions build.sbt
Expand Up @@ -34,6 +34,7 @@ lazy val commonSettings = Seq(
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
autoAPIMappings := true,

publishTo := {
val sonatype = "https://oss.sonatype.org/"
Expand Down

0 comments on commit f1e1073

Please sign in to comment.