Skip to content

Instantly share code, notes, and snippets.

@bjhargrave
Created October 2, 2017 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjhargrave/4cb2fed7a3aa6460e5762dbd38fee050 to your computer and use it in GitHub Desktop.
Save bjhargrave/4cb2fed7a3aa6460e5762dbd38fee050 to your computer and use it in GitHub Desktop.
Bash script to upload Bnd build to bintray
#!/bin/bash
# find -E biz -regex '.*\.(pom|jar)$' -exec bintrayup.sh "{}" ";"
BINTRAY_USER=xxx
BINTRAY_API_KEY=yyy
SLUG=bnd/bnd
file=$1
packageprefix=${file%/*/*}
versionprefix=${file%/*}
package=${packageprefix##*/}
version=${versionprefix##*/}
echo curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -X POST -H Content-Type:\ application/json -d \{\"name\":\"${version}\"\,\"desc\":\"\"\,\"vcs_tag\":\"${version}.REL\"\} https://api.bintray.com/packages/${SLUG}/${package}/versions
curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -X POST -H Content-Type:\ application/json -d \{\"name\":\"${version}\"\,\"desc\":\"\"\,\"vcs_tag\":\"${version}.REL\"\} https://api.bintray.com/packages/${SLUG}/${package}/versions
echo curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -T ${file} https://api.bintray.com/maven/${SLUG}/${package}/${file}
curl -u${BINTRAY_USER}:${BINTRAY_API_KEY} -T ${file} https://api.bintray.com/maven/${SLUG}/${package}/${file}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment