From 2b360c66d413eea7115c28bda96cc2967f05b169 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 6 Mar 2017 16:40:18 +0100 Subject: [PATCH] Tweaked deployment script to use variables for bintray stuff, added description at top (by @lordofhyphens) --- package/deploy-bintray.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/package/deploy-bintray.sh b/package/deploy-bintray.sh index c712560dc3..e1bc83620d 100755 --- a/package/deploy-bintray.sh +++ b/package/deploy-bintray.sh @@ -1,9 +1,14 @@ #!/bin/bash +# Prerequistes +# Environment variables: +# BINTRAY_API_KEY - Working API key +# BINTRAY_API_USER - Bintray username. +# SLIC3R_VERSION - Development version # for Slic3r + + if [ $(git describe &>/dev/null) ]; then - TAGGED=true SLIC3R_BUILD_ID=$(git describe) - else - TAGGED=false +else SLIC3R_BUILD_ID=${SLIC3R_VERSION}d-$(git rev-parse --short head) fi @@ -20,9 +25,12 @@ fi file=$1 echo "Deploying $file to $version on Bintray..." API=${BINTRAY_API_KEY} +USER=${BINTRAY_API_USER} -curl -X POST -d "{ \"name\": \"$version\", \"released\": \"ISO8601 $(date +%Y-%m-%d'T'%H:%M:%S)\", \"desc\": \"This version...\", \"github_release_notes_file\": \"RELEASE.txt\", \"github_use_tag_release_notes\": true, \"vcs_tag\": \"$version\" }" -ulordofhyphens:${API} https://api.bintray.com/content/lordofhyphens/Slic3r/slic3r_dev/versions +curl -X POST -d "{ \"name\": \"$version\", \"released\": \"ISO8601 $(date +%Y-%m-%d'T'%H:%M:%S)\", \"desc\": \"This version...\", \"github_release_notes_file\": \"RELEASE.txt\", \"github_use_tag_release_notes\": true, \"vcs_tag\": \"$version\" }" -u${USER}:${API} https://api.bintray.com/content/lordofhyphens/Slic3r/${SLIC3R_PKG}/versions -curl -H "X-Bintray-Package: $SLIC3R_PKG" -H "X-Bintray-Version: $version" -H 'X-Bintray-Publish: 1' -H 'X-Bintray-Override: 1' -T $file -ulordofhyphens:${API} https://api.bintray.com/content/lordofhyphens/Slic3r/$(basename $1) +curl -H "X-Bintray-Package: $SLIC3R_PKG" -H "X-Bintray-Version: $version" -H 'X-Bintray-Publish: 1' -H 'X-Bintray-Override: 1' -T $file -u${USER}:${API} https://api.bintray.com/content/lordofhyphens/Slic3r/$(basename $1) +echo "Publishing $file..." +curl -X POST -u${USER}:${API} https://api.bintray.com/content/lordofhyphens/Slic3r/${SLIC3R_PKG}/$version/publish -curl -H 'Content-Type: application/json' -X PUT -d "{ \"list_in_downloads\":true }" -ulordofhyphens:${API} https://api.bintray.com/file_metadata/lordofhyphens/Slic3r/$(basename $1) +curl -H 'Content-Type: application/json' -X PUT -d "{ \"list_in_downloads\":true }" -u${USER}:${API} https://api.bintray.com/file_metadata/lordofhyphens/Slic3r/$(basename $1)