Skip to content

Instantly share code, notes, and snippets.

@npryce
Created April 25, 2014 08:28
Show Gist options
  • Save npryce/11282060 to your computer and use it in GitHub Desktop.
Save npryce/11282060 to your computer and use it in GitHub Desktop.
A shell script to publish JARs to the Bintray Maven repository
#!/bin/sh
set -e
if [ ! -f ~/.bintray-login ]
then
echo save your bintray.com <userid>:<api-key> in ~/.bintray-login
exit 1
fi
groupid=${1:?group-id}
package=${2:?package}
version=${3:?version}
bintray_login=`cat ~/.bintray-login`
group_subdir=`echo $groupid | tr . /`
reporoot=https://api.bintray.com/content/npryce/maven/${package}/${version}/${group_subdir}/${package}/${version}
shift 3
if [ -z $1 ]
then
echo "no files given"
exit 1
fi
for f in "$@"
do
curl -T $f -u${bintray_login} ${reporoot}/`basename $f`
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment