forked from phoedos/pmd
Travis Build fixes
* Do only perform a release, if building from tag * Add missing git config * Output github releases request in case of error
This commit is contained in:
@ -4,10 +4,10 @@ set -ev
|
|||||||
VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
|
VERSION=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.5.0:exec)
|
||||||
echo "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
|
echo "Building PMD ${VERSION} on branch ${TRAVIS_BRANCH}"
|
||||||
|
|
||||||
if [[ "$VERSION" == *-SNAPSHOT ]]; then
|
if [[ "$VERSION" != *-SNAPSHOT && "$TRAVIS_TAG" != "" ]]; then
|
||||||
mvn deploy -Possrh -B -V
|
|
||||||
else
|
|
||||||
mvn deploy -Possrh,pmd-release -B -V
|
mvn deploy -Possrh,pmd-release -B -V
|
||||||
|
else
|
||||||
|
mvn deploy -Possrh -B -V
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash .travis/build-site.sh
|
bash .travis/build-site.sh
|
||||||
@ -20,9 +20,10 @@ bash .travis/build-site.sh
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Uploading pmd distribution to sourceforge
|
# Uploading pmd distribution to sourceforge
|
||||||
rsync -avh pmd-dist/target/pmd-*-${VERSION}.zip target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
|
if [ "$TRAVIS_TAG" = "" ]; then
|
||||||
rsync -avh src/site/markdown/overview/changelog.md ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/ReadMe.md
|
rsync -avh pmd-dist/target/pmd-*-${VERSION}.zip target/pmd-doc-${VERSION}.zip ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/
|
||||||
|
rsync -avh src/site/markdown/overview/changelog.md ${PMD_SF_USER}@web.sourceforge.net:/home/frs/project/pmd/pmd/${VERSION}/ReadMe.md
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
|
if [[ "$VERSION" == *-SNAPSHOT && "$TRAVIS_BRANCH" == "master" ]]; then
|
||||||
# Uploading snapshot site...
|
# Uploading snapshot site...
|
||||||
|
@ -26,8 +26,12 @@ cat > release-edit-request.json <<EOF
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
echo "Updating release at https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}..."
|
echo "Updating release at https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}..."
|
||||||
curl -i -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" -H "Content-Type: application/json" --data-binary "@release-edit-request.json" -X PATCH https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID}|grep "^HTTP"
|
RESPONSE=$(curl -i -s -H "Authorization: token ${GITHUB_OAUTH_TOKEN}" -H "Content-Type: application/json" --data-binary "@release-edit-request.json" -X PATCH https://api.github.com/repos/pmd/pmd/releases/${RELEASE_ID})
|
||||||
|
if [[ "$RESPONSE" != *"HTTP/1.1 200"* ]]; then
|
||||||
|
echo "$RESPONSE"
|
||||||
|
else
|
||||||
|
echo "Update OK"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -37,6 +41,8 @@ git clone --depth 1 git@github.com:pmd/pmd.github.io.git
|
|||||||
rsync -a target/pmd-doc-${RELEASE_VERSION}/ pmd.github.io/pmd-${RELEASE_VERSION}/
|
rsync -a target/pmd-doc-${RELEASE_VERSION}/ pmd.github.io/pmd-${RELEASE_VERSION}/
|
||||||
(
|
(
|
||||||
cd pmd.github.io
|
cd pmd.github.io
|
||||||
|
git config user.email "adangel@users.sourceforge.net"
|
||||||
|
git config user.name "Andreas Dangel (PMD Releases)"
|
||||||
git add pmd-${RELEASE_VERSION}
|
git add pmd-${RELEASE_VERSION}
|
||||||
git commit -m "Added pmd-${RELEASE_VERSION}"
|
git commit -m "Added pmd-${RELEASE_VERSION}"
|
||||||
git rm -qr latest
|
git rm -qr latest
|
||||||
|
Reference in New Issue
Block a user