From c1b4032aa38ddd54304df076c29196a18a0f1e8f Mon Sep 17 00:00:00 2001 From: Ajay Kannan Date: Wed, 6 Apr 2016 18:33:13 -0700 Subject: [PATCH] Use curl instead of maven wagon --- utilities/after_success.sh | 6 ++++-- utilities/update_docs_version.sh | 2 +- utilities/update_pom_version.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/utilities/after_success.sh b/utilities/after_success.sh index 7024118c54ff..25c0c7c4f262 100755 --- a/utilities/after_success.sh +++ b/utilities/after_success.sh @@ -19,8 +19,10 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" ]; then fi if [ "${SITE_VERSION##*-}" != "SNAPSHOT" ]; then # Deploy Maven artifacts (if they don't exist yet) and update artifact version in READMEs. - ARTIFACT_EXISTS=$(mvn wagon:exist -Dwagon.url=https://oss.sonatype.org/content/repositories/releases/com/google/gcloud/gcloud-java/$SITE_VERSION) - if [[ "$ARTIFACT_EXISTS" == *"does not exists."* -a "$ARTIFACT_EXISTS" != "" ]]; then + 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." + else mvn clean deploy -DskipITs --settings ~/.m2/settings.xml -P sign-deploy fi utilities/update_docs_version.sh diff --git a/utilities/update_docs_version.sh b/utilities/update_docs_version.sh index 278f4d4e3c6c..4649fff53b16 100755 --- a/utilities/update_docs_version.sh +++ b/utilities/update_docs_version.sh @@ -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 2 \( -regex "./gcloud-java[-[a-z]+]*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]*" \) -type d) . ./gcloud-java) + module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+" \) -type d) . ./gcloud-java) for item in ${module_folders[*]} do sed -ri "s/[0-9]+\.[0-9]+\.[0-9]+<\/version>/${RELEASED_VERSION}<\/version>/g" ${item}/README.md diff --git a/utilities/update_pom_version.sh b/utilities/update_pom_version.sh index d7d55b0d6735..ec739967cfa3 100755 --- a/utilities/update_pom_version.sh +++ b/utilities/update_pom_version.sh @@ -11,7 +11,7 @@ # Get the previous maven project version. CURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)') # Get list of directories for which pom.xml must be updated -module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]*" \) -type d) . ./gcloud-java) +module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+" \) -type d) . ./gcloud-java) if [ $# -eq 1 ]; then NEW_VERSION=$1 elif [ "${CURRENT_VERSION##*-}" != "SNAPSHOT" ]; then