sijie closed pull request #1223: Enable buiding website on travis job if a PR
is modifying `site`
URL: https://github.com/apache/bookkeeper/pull/1223
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/.travis.yml b/.travis.yml
index 039999e06..156a0ba9c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,6 +21,9 @@ branches:
- asf-site
- gh-pages
+services:
+ - docker
+
matrix:
include:
- os: osx
@@ -53,13 +56,34 @@ before_install:
export DLOG_MODIFIED="true"
echo "Enable testing distributedlog modules if this pull request
modifies files under directory `stream/distributedlog`."
fi
+ if [ `git diff --name-only $TRAVIS_COMMIT_RANGE | grep "^site\/" | wc
-l` -gt 0 ]; then
+ # building the website to ensure the changes don't break
+ export WEBSITE_MODIFIED="true"
+ echo "Enable building website modules if this pull request
modifies files under directory `site`."
+ fi
fi
script:
- - travis_retry mvn --batch-mode clean apache-rat:check compile
spotbugs:check install -DskipTests
- - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz; fi
- - if [ "$TRAVIS_OS_NAME" == "linux" ]; then dev/check-binary-license
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz; fi
- - if [ "$DLOG_MODIFIED" == "true" ]; then cd stream/distributedlog &&
travis_wait 60 mvn --batch-mode clean package -Ddistributedlog; fi
+- |
+ set -e
+ mvn --batch-mode clean apache-rat:check compile spotbugs:check install
-DskipTests
+ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+ dev/check-binary-license
./bookkeeper-dist/all/target/bookkeeper-all-*-bin.tar.gz;
+ dev/check-binary-license
./bookkeeper-dist/server/target/bookkeeper-server-*-bin.tar.gz;
+ fi
+ if [ "$DLOG_MODIFIED" == "true" ]; then
+ cd stream/distributedlog
+ travis_wait 60 mvn --batch-mode clean package -Ddistributedlog
+ cd ../..
+ fi
+ if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$WEBSITE_MODIFIED" == "true" ];
then
+ cd site
+ make clean
+ # run the docker image to build the website
+ ./docker/ci.sh
+ cd ..
+ fi
+
# Disabled the tests here. Since tests are running much slower on Travis than
on Jenkins
# - ./dev/ticktoc.sh "mvn --batch-mode clean package"
diff --git a/site/_config.yml b/site/_config.yml
index 9a059c36e..1300a3f1d 100644
--- a/site/_config.yml
+++ b/site/_config.yml
@@ -67,3 +67,4 @@ exclude:
- scripts
- overview
- README.md
+
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services