docs: tweak formatting in pmrep(1) archive folio example
[pcp.git] / scripts / bintray-version
blobf9ef75921c0f45ab8a3b3f68df83de0605070f81
1 #!/bin/sh
2 #
3 # Automate updating package version metadata on bintray.com.
4 # This script should only be run run *after* binary uploads.
7 # Run in the top-level of a tree, ensuring .bintrayrc is available with
8 # valid user setting (username, email, apikey, distro, gpgphrase).
10 topdir=`pwd`
12 quit()
14 echo $*
15 exit 1
18 [ -e "${topdir}/VERSION.pcp" ] || quit "Not a PCP git tree, missing VERSION.pcp"
19 [ -e "${topdir}/.bintrayrc" ] || quit "Tree is unconfigured, missing .bintrayrc"
21 . ${topdir}/.bintrayrc
22 . ${topdir}/VERSION.pcp
24 version=${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_REVISION}
25 date=`date "+%Y-%m-%dT00:00:00.000Z"`
27 [ -z "${user}" ] && quit "user is not configured (via .bintrayrc)"
28 [ -z "${email}" ] && quit "email is not configured (via .bintrayrc)"
29 [ -z "${apikey}" ] && quit "apikey is not configured (via .bintrayrc)"
30 [ -z "${gpgpass}" ] && quit "passphrase is not configured (via .bintrayrc)"
32 version_update()
34 distro="$1"; desc="$2"
36 url="https://api.bintray.com/packages/pcp/${distro}/pcp/versions/${version}"
37 echo "Updating ${distro} information for ${version}:" && echo " ${url}"
38 curl \
39 -u ${user}:${apikey} \
40 -H "X-GPG-PASSPHRASE: ${gpgpass}" \
41 -H "Content-Type:application/json" \
42 -H "Accept: application/json" \
43 --request PATCH \
44 --data "{\"desc\":\"$desc\",\"vcs_tag\":\"$version\",\"released\":\"$date\"}" \
45 "${url};bt_package=pcp;bt_version=${version};publish=1"
46 echo
49 version_update source "Performance Co-Pilot source code, gzipped tarball"
50 version_update el5 "Performance Co-Pilot builds for EL5"
51 version_update el6 "Performance Co-Pilot builds for EL6"
52 version_update el7 "Performance Co-Pilot builds for EL7"
53 version_update f21 "Performance Co-Pilot builds for Fedora 21"
54 version_update f22 "Performance Co-Pilot builds for Fedora 22"
55 version_update jessie "Performance Co-Pilot builds for Debian 7 (jessie)"
56 version_update wheezy "Performance Co-Pilot builds for Debian 8 (wheezy)"
57 version_update trusty "Performance Co-Pilot builds for Ubuntu 14.04 (trusty tahr)"
58 version_update vivid "Performance Co-Pilot builds for Ubuntu 15.04 (vivid vervet)"
59 version_update solaris11 "Performance Co-Pilot builds for Solaris 11"
60 version_update opensuse13 "Performance Co-Pilot builds for OpenSUSE 13"