Cleanup build scripts by ajkannan · Pull Request #858 · googleapis/google-cloud-java · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RELEASING.md
23 changes: 17 additions & 6 deletions utilities/after_success.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "travis@travis-ci.org"
git clone --branch gh-pages --single-branch https://github.com/GoogleCloudPlatform/gcloud-java/ tmp_gh-pages
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utilities/update_docs_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RELEASED_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate
if [ "${RELEASED_VERSION##*-}" != "SNAPSHOT" ]; then
echo "Changing version to $RELEASED_VERSION in README files"
# Get list of directories for which README.md must be updated
module_folders=($(find . -maxdepth 1 -name 'gcloud-java*' -type d) .)
module_folders=($(find . -maxdepth 2 -type d | sed -E -n "/^\.\/(gcloud-java-contrib\/)?gcloud-java(-[a-z]+)+$/p") . ./gcloud-java)
for item in ${module_folders[*]}
do
sed -ri "s/<version>[0-9]+\.[0-9]+\.[0-9]+<\/version>/<version>${RELEASED_VERSION}<\/version>/g" ${item}/README.md
Expand Down
3 changes: 1 addition & 2 deletions utilities/update_pom_version.sh