Skip to content

Commit 75fefc3

Browse files
committed
ci-build.sh: fix scm extraction failure handling
1 parent 5c09247 commit 75fefc3

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

ci-build.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,19 @@ EOL
8585
fi
8686

8787
# Determine whether deploying will be possible.
88+
echo "Performing deployment checks"
8889
deployOK=
89-
scmURL=$(mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args='${project.scm.url}' --non-recursive validate exec:exec 2>&1)
90-
scmURL=${scmURL%.git}
91-
scmURL=${scmURL%/}
9290

93-
if [ $? -ne 0 ]; then
91+
scmURL=$(mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args='${project.scm.url}' --non-recursive validate exec:exec 2>&1)
92+
result=$?
93+
checkSuccess $result
94+
if [ $result -ne 0 ]; then
9495
echo "No deploy -- could not extract ciManagement URL"
9596
echo "Output of failed attempt follows:"
9697
echo "$scmURL"
9798
else
99+
scmURL=${scmURL%.git}
100+
scmURL=${scmURL%/}
98101
if [ ! "$SIGNING_ASC" -o ! "$GPG_KEY_NAME" -o ! "$GPG_PASSPHRASE" -o ! "$MAVEN_PASS" -o ! "$OSSRH_PASS" ]; then
99102
echo "No deploy -- secure environment variables not available"
100103
elif [ "$BUILD_REPOSITORY" -a "$BUILD_REPOSITORY" != "$scmURL" ]; then

0 commit comments

Comments
 (0)