Skip to content

Commit c1b4032

Browse files
author
Ajay Kannan
committed
Use curl instead of maven wagon
1 parent 72aafe4 commit c1b4032

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

utilities/after_success.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ if [ "${TRAVIS_JDK_VERSION}" == "oraclejdk7" ]; then
1919
fi
2020
if [ "${SITE_VERSION##*-}" != "SNAPSHOT" ]; then
2121
# Deploy Maven artifacts (if they don't exist yet) and update artifact version in READMEs.
22-
ARTIFACT_EXISTS=$(mvn wagon:exist -Dwagon.url=https://oss.sonatype.org/content/repositories/releases/com/google/gcloud/gcloud-java/$SITE_VERSION)
23-
if [[ "$ARTIFACT_EXISTS" == *"does not exists."* -a "$ARTIFACT_EXISTS" != "" ]]; then
22+
URL=https://oss.sonatype.org/content/repositories/releases/com/google/gcloud/gcloud-java/$SITE_VERSION
23+
if curl --output /dev/null --silent --head --fail "$URL"; then
24+
echo "Not deploying artifacts because it seems like they already exist."
25+
else
2426
mvn clean deploy -DskipITs --settings ~/.m2/settings.xml -P sign-deploy
2527
fi
2628
utilities/update_docs_version.sh

utilities/update_docs_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RELEASED_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate
1010
if [ "${RELEASED_VERSION##*-}" != "SNAPSHOT" ]; then
1111
echo "Changing version to $RELEASED_VERSION in README files"
1212
# Get list of directories for which README.md must be updated
13-
module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]*" \) -type d) . ./gcloud-java)
13+
module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+" \) -type d) . ./gcloud-java)
1414
for item in ${module_folders[*]}
1515
do
1616
sed -ri "s/<version>[0-9]+\.[0-9]+\.[0-9]+<\/version>/<version>${RELEASED_VERSION}<\/version>/g" ${item}/README.md

utilities/update_pom_version.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Get the previous maven project version.
1212
CURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)')
1313
# Get list of directories for which pom.xml must be updated
14-
module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]*" \) -type d) . ./gcloud-java)
14+
module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+" \) -type d) . ./gcloud-java)
1515
if [ $# -eq 1 ]; then
1616
NEW_VERSION=$1
1717
elif [ "${CURRENT_VERSION##*-}" != "SNAPSHOT" ]; then

0 commit comments

Comments
 (0)