Last active
August 29, 2015 14:23
-
-
Save marc0der/bcef128d73821d349f37 to your computer and use it in GitHub Desktop.
Add all versions of Groovy on BinTray to GVM/SDKman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('com.github.groovy-wslite:groovy-wslite:1.1.2') | |
import wslite.rest.* | |
def consumerKey = "CONSUMER_KEY" | |
def consumerToken = "CONSUMER_TOKEN" | |
def host = "https://bintray.com" | |
def client = new RESTClient(host) | |
def releaseClient = new RESTClient("https://gvm-vendor-dev.herokuapp.com") | |
new File("versions.txt").eachLine() { String version -> | |
try { | |
def path = "/artifact/download/groovy/maven/groovy-binary-${version}.zip" | |
client.head(path: "$path") | |
def headers = [ | |
"consumer_key": consumerKey, | |
"consumer_token": consumerToken | |
] | |
releaseClient.post(path: "/release", headers: headers) { | |
type "application/json" | |
json candidate: "groovy", version: "$version", url: "$host/$path" | |
} | |
println "$version was released!" | |
} catch (RESTClientException rce) { | |
println "$version problems: $rce.message" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment