Skip to content

Commit 6cc9744

Browse files
committed
Made the binary push script a bit friendlier for humans
1 parent 58cb15c commit 6cc9744

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

push-binary-libs.sh

+5
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,10 @@
44

55
. $(dirname $0)/tools/binary-repo-lib.sh
66

7+
if test $# -lt 2; then
8+
echo "Usage: $0 <username> <password>"
9+
exit 1
10+
fi
11+
712
# TODO - Argument parsing for username/password.
813
pushJarFiles $(pwd) $1 $2

tools/binary-repo-lib.sh

+9-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pushJarFile() {
7777
local remote_uri=${version}${jar#$basedir}
7878
echo " Pushing to ${remote_urlbase}/${remote_uri} ..."
7979
echo " $curl"
80-
local curl=$(curlUpload $remote_uri $jar_name $user $pw)
80+
curlUpload $remote_uri $jar_name $user $pw
8181
echo " Making new sha1 file ...."
8282
echo "$jar_sha1" > "${jar_name}${desired_ext}"
8383
popd >/dev/null
@@ -112,14 +112,20 @@ pushJarFiles() {
112112
local password=$3
113113
# TODO - ignore target/ and build/
114114
local jarFiles="$(find ${basedir}/lib -name "*.jar") $(find ${basedir}/test/files -name "*.jar")"
115+
local changed="no"
115116
for jar in $jarFiles; do
116117
local valid=$(isJarFileValid $jar)
117118
if [[ "$valid" != "OK" ]]; then
118119
echo "$jar has changed, pushing changes...."
120+
changed="yes"
119121
pushJarFile $jar $basedir $user $password
120122
fi
121123
done
122-
echo "Binary changes have been pushed. You may now submit the new *${desired_ext} files to git."
124+
if test "$changed" == "no"; then
125+
echo "No jars have been changed."
126+
else
127+
echo "Binary changes have been pushed. You may now submit the new *${desired_ext} files to git."
128+
fi
123129
}
124130

125131
# Pulls a single binary artifact from a remote repository.
@@ -141,7 +147,7 @@ pullJarFile() {
141147
# Argument 1 - The directory to search for *.desired.sha1 files that need to be retrieved.
142148
pullJarFiles() {
143149
local basedir=$1
144-
local desiredFiles="$(find ${basedir}/lib -name *${desired_ext}) $(find ${basedir}/test/files -name *${desired_ext})"
150+
local desiredFiles="$(find ${basedir}/lib -name *${desired_ext}) $(find ${basedir}/test/files -name *${desired_ext}) $(find ${basedir}/tools -name *${desired_ext})"
145151
for sha in $desiredFiles; do
146152
jar=${sha%$desired_ext}
147153
local valid=$(isJarFileValid $jar)

0 commit comments

Comments
 (0)