-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ajay Kannan
committed
Apr 12, 2016
1 parent
de23a12
commit 159241f
Showing
4 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,23 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" ]; then | |
if [ "${TRAVIS_PULL_REQUEST}" == "false" -a "${TRAVIS_BRANCH}" == "master" ]; then | ||
source ./utilities/integration_test_env.sh | ||
SITE_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)') | ||
echo "Used the maven-help-plugin to determine that the version is $SITE_VERSION" | ||
if [ "$SITE_VERSION" == "" ]; then | ||
echo "Could not determine the version, so we're exiting." | ||
exit 1 | ||
fi | ||
if [ "${SITE_VERSION##*-}" != "SNAPSHOT" ]; then | ||
# Deploy site if not a SNAPSHOT | ||
# Deploy Maven artifacts (if they don't exist yet) and update artifact version in READMEs. | ||
URL=https://oss.sonatype.org/content/repositories/releases/com/google/gcloud/gcloud-java/$SITE_VERSION/ | ||
if curl --output /dev/null --silent --head --fail "$URL"; then | ||
echo "Not deploying artifacts because it seems like they already exist." | ||
echo "Existence was checked using the url $URL" | ||
else | ||
mvn clean deploy -DskipITs --settings ~/.m2/settings.xml -P sign-deploy,release | ||
fi | ||
utilities/update_docs_version.sh | ||
|
||
# Create website | ||
git config --global user.name "travis-ci" | ||
git config --global user.email "[email protected]" | ||
git clone --branch gh-pages --single-branch https://github.com/GoogleCloudPlatform/gcloud-java/ tmp_gh-pages | ||
|
@@ -28,13 +43,9 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" ]; then | |
git add index.html | ||
echo "<html><head><script>window.location.replace('/gcloud-java/${SITE_VERSION}/apidocs' + location.search)</script></head><body></body></html>" > apidocs/index.html | ||
git add apidocs/index.html | ||
git commit -m "Added a new site for version $SITE_VERSION and updated the root directory's redirect." | ||
git commit -m "Added a new site for version $SITE_VERSION and updated the root directory's redirect. [ci skip]" | ||
git config --global push.default simple | ||
git push --quiet "https://${CI_DEPLOY_USERNAME}:${CI_DEPLOY_PASSWORD}@github.com/GoogleCloudPlatform/gcloud-java.git" > /dev/null 2>&1 | ||
|
||
cd .. | ||
utilities/update_docs_version.sh # Update version in READMEs | ||
mvn clean deploy --settings ~/.m2/settings.xml -P sign-deploy,release | ||
else | ||
mvn clean deploy -DskipTests=true -Dgpg.skip=true --settings ~/.m2/settings.xml -P release | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters