Skip to content

Commit 7edaa04

Browse files
committed
travis-build: show how ciManagement command fails
1 parent 1461866 commit 7edaa04

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

travis-build.sh

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,24 +89,31 @@ EOL
8989
fi
9090

9191
# Determine whether deploying will be possible.
92-
ciURL=$(mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args='${project.ciManagement.url}' --non-recursive validate exec:exec 2>/dev/null)
93-
ciRepo=${ciURL##*/}
94-
ciPrefix=${ciURL%/*}
95-
ciOrg=${ciPrefix##*/}
9692
deployOK=
97-
if [ "$TRAVIS_SECURE_ENV_VARS" != true ]
93+
ciURL=$(mvn -q -Denforcer.skip=true -Dexec.executable=echo -Dexec.args='${project.ciManagement.url}' --non-recursive validate exec:exec 2>&1)
94+
if [ $? -ne 0 ]
9895
then
99-
echo "No deploy -- secure environment variables not available"
100-
elif [ "$TRAVIS_PULL_REQUEST" != false ]
101-
then
102-
echo "No deploy -- pull request detected"
103-
elif [ "$TRAVIS_REPO_SLUG" != "$ciOrg/$ciRepo" ]
104-
then
105-
echo "No deploy -- repository fork: $TRAVIS_REPO_SLUG != $ciOrg/$ciRepo"
106-
# TODO: Detect travis-ci.org versus travis-ci.com?
96+
echo "No deploy -- could not extract ciManagement URL"
97+
echo "Output of failed attempt follows:"
98+
echo "$ciURL"
10799
else
108-
echo "All checks passed for artifact deployment"
109-
deployOK=1
100+
ciRepo=${ciURL##*/}
101+
ciPrefix=${ciURL%/*}
102+
ciOrg=${ciPrefix##*/}
103+
if [ "$TRAVIS_SECURE_ENV_VARS" != true ]
104+
then
105+
echo "No deploy -- secure environment variables not available"
106+
elif [ "$TRAVIS_PULL_REQUEST" != false ]
107+
then
108+
echo "No deploy -- pull request detected"
109+
elif [ "$TRAVIS_REPO_SLUG" != "$ciOrg/$ciRepo" ]
110+
then
111+
echo "No deploy -- repository fork: $TRAVIS_REPO_SLUG != $ciOrg/$ciRepo"
112+
# TODO: Detect travis-ci.org versus travis-ci.com?
113+
else
114+
echo "All checks passed for artifact deployment"
115+
deployOK=1
116+
fi
110117
fi
111118

112119
# Install GPG on OSX/macOS

0 commit comments

Comments
 (0)