[ci] [docs] Improved detection for changes in documentation
Now only updating docs on sourceforge, if there are changes
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source .travis/common-functions.sh
|
||||
source .travis/logger.sh
|
||||
source .travis/common-functions.sh
|
||||
|
||||
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
|
||||
log_info "Building PMD Coveralls.io report ${VERSION} on branch ${TRAVIS_BRANCH}"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source .travis/common-functions.sh
|
||||
source .travis/logger.sh
|
||||
source .travis/common-functions.sh
|
||||
|
||||
function push_docs() {
|
||||
if git diff --quiet docs; then
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source .travis/common-functions.sh
|
||||
source .travis/logger.sh
|
||||
source .travis/common-functions.sh
|
||||
|
||||
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
|
||||
log_info "Building PMD Documentation ${VERSION} on branch ${TRAVIS_BRANCH}"
|
||||
@ -41,7 +41,7 @@ zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
|
||||
fi
|
||||
|
||||
# rsync site to pmd.sourceforge.net/snapshot
|
||||
if [[ "${VERSION}" == *-SNAPSHOT && "${TRAVIS_BRANCH}" == "master" ]]; then
|
||||
if [[ "${VERSION}" == *-SNAPSHOT && "${TRAVIS_BRANCH}" == "master" ]] && has_docs_change; then
|
||||
echo -e "\n\n"
|
||||
log_info "Uploading snapshot site to pmd.sourceforge.net/snapshot..."
|
||||
travis_wait rsync -ah --stats --delete pmd-doc-${VERSION}/ ${PMD_SF_USER}@web.sourceforge.net:/home/project-web/pmd/htdocs/snapshot/
|
||||
@ -57,18 +57,6 @@ zip -qr pmd-doc-${VERSION}.zip pmd-doc-${VERSION}/
|
||||
|
||||
|
||||
|
||||
|
||||
has_docs_change() {
|
||||
if [[ $(git diff --name-only ${TRAVIS_COMMIT_RANGE}) = *"docs/"* ]]; then
|
||||
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): changes found"
|
||||
return 0
|
||||
else
|
||||
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): no changes"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Push the generated site to gh-pages branch
|
||||
#
|
||||
|
@ -1,8 +1,8 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
source .travis/common-functions.sh
|
||||
source .travis/logger.sh
|
||||
source .travis/common-functions.sh
|
||||
|
||||
VERSION=$(./mvnw -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec | tail -1)
|
||||
log_info "Building PMD Sonar ${VERSION} on branch ${TRAVIS_BRANCH}"
|
||||
|
@ -26,3 +26,13 @@ function travis_isPush() {
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function has_docs_change() {
|
||||
if [[ $(git diff --name-only ${TRAVIS_COMMIT_RANGE}) = *"docs/"* ]]; then
|
||||
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): changes found"
|
||||
return 0
|
||||
else
|
||||
log_info "Checking for changes in docs/ (TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}): no changes"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user