2017-02-25 11:31:09 +01:00
|
|
|
#!/bin/bash
|
2017-05-20 10:16:29 +02:00
|
|
|
set -e
|
2017-02-25 11:31:09 +01:00
|
|
|
|
2017-05-20 09:55:09 +02:00
|
|
|
source .travis/common-functions.sh
|
2017-05-15 21:11:43 +02:00
|
|
|
|
|
|
|
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
|
|
|
|
echo "Building PMD Site ${VERSION} on branch ${TRAVIS_BRANCH}"
|
|
|
|
|
2017-05-20 10:43:14 +02:00
|
|
|
if ! travis_isPush; then
|
2017-05-15 21:11:43 +02:00
|
|
|
echo "Not building site, since this is not a push!"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2017-06-03 10:23:25 +02:00
|
|
|
(
|
2017-06-24 17:28:40 -03:00
|
|
|
# Run the build, truncate output due to Travis log limits
|
2017-07-08 12:15:17 +02:00
|
|
|
|
2017-07-19 20:47:07 +02:00
|
|
|
echo -e "\n\nExecuting ./mvnw install..."
|
2017-07-08 13:10:32 +02:00
|
|
|
travis_wait ./mvnw install -DskipTests=true -B -V -q
|
2017-07-19 20:47:07 +02:00
|
|
|
echo "Finished executing ./mvnw install"
|
2017-07-08 12:15:17 +02:00
|
|
|
|
2017-07-19 20:47:07 +02:00
|
|
|
echo -e "\n\nExecuting ./mvnw site site:stage...
|
|
|
|
travis_wait 40 ./mvnw site site:stage -DskipTests=true -Psite -B -V -q
|
|
|
|
echo "Finished executing ./mvnw site site:stage..."
|
2017-06-03 10:23:25 +02:00
|
|
|
)
|
2017-05-15 21:11:43 +02:00
|
|
|
|
2017-07-08 12:15:17 +02:00
|
|
|
echo -e "\n\nCreating pmd-doc archive...\n\n"
|
2017-05-15 21:11:43 +02:00
|
|
|
(
|
|
|
|
cd target
|
|
|
|
mv staging pmd-doc-${VERSION}
|
|
|
|
zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
|
|
|
|
)
|
|
|
|
|
|
|
|
# Uploading pmd doc distribution to sourceforge
|
|
|
|
if [[ "$TRAVIS_TAG" != "" || "$VERSION" == *-SNAPSHOT ]]; then
|
|
|
|
rsync -avh target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
|
|
|
|
fi
|
|
|
|
|
2017-06-11 10:50:42 +02:00
|
|
|
(
|
|
|
|
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
|
2017-07-08 12:15:17 +02:00
|
|
|
echo -e "\n\nUploading snapshot site...\n\n"
|
2017-07-08 13:10:32 +02:00
|
|
|
travis_wait rsync -ah --stats --delete target/pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
|
2017-06-11 10:50:42 +02:00
|
|
|
fi
|
|
|
|
)
|