github.com/ezbuy/gauge@v0.9.4-0.20171013092048-7ac5bd3931cd/build/publish_templates_to_bintray.sh (about) 1 #!/bin/sh 2 3 # Copyright 2015 ThoughtWorks, Inc. 4 5 # This file is part of Gauge. 6 7 # Gauge is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 3 of the License, or 10 # (at your option) any later version. 11 12 # Gauge is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 17 # You should have received a copy of the GNU General Public License 18 # along with Gauge. If not, see <http://www.gnu.org/licenses/>. 19 20 if [ -z "$BINTRAY_USER" ]; then 21 echo "BINTRAY_USER is not set" 22 exit 1 23 fi 24 25 if [ -z "$BINTRAY_API_KEY" ]; then 26 echo "BINTRAY_API_KEY is not set" 27 exit 1 28 fi 29 30 if [ -z "$PACKAGE" ]; then 31 PACKAGE="Templates" 32 fi 33 34 if [ -z "$BINTRAY_PACKAGE" ]; then 35 BINTRAY_PACKAGE="gauge-templates" 36 fi 37 38 for i in `ls *.zip`; do 39 URL="https://api.bintray.com/content/gauge/$PACKAGE/$BINTRAY_PACKAGE/latest/$i?publish=1&override=1" 40 echo "Uploading to : $URL" 41 42 RESPONSE_CODE=$(curl -T $i -u$BINTRAY_USER:$BINTRAY_API_KEY $URL -I -s -w "%{http_code}" -o /dev/null); 43 if [[ "${RESPONSE_CODE:0:2}" != "20" ]]; then 44 echo "Unable to upload, HTTP response code: $RESPONSE_CODE" 45 exit 1 46 fi 47 echo "HTTP response code: $RESPONSE_CODE" 48 done;