Skip to content

Instantly share code, notes, and snippets.

@marc0der
Last active August 29, 2015 14:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marc0der/bcef128d73821d349f37 to your computer and use it in GitHub Desktop.
Save marc0der/bcef128d73821d349f37 to your computer and use it in GitHub Desktop.
Add all versions of Groovy on BinTray to GVM/SDKman
@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