Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jenkinsおじさんと楽しい連携ツールたち

toshihirock
January 10, 2015

 Jenkinsおじさんと楽しい連携ツールたち

Jenkinsユーザーカンファレンス2015東京LT

toshihirock

January 10, 2015
Tweet

More Decks by toshihirock

Other Decks in Technology

Transcript

  1. import groovy.json.* ext { jenkinsUrl = 'http://localhost:8080' buildNumber = System.getenv("BUILD_NUMBER");

    jobName = System.getenv("JOB_NAME"); println "build number is ${buildNumber}" println "jobName is ${jobName}" } def getJson(url) { println "start getJson $url" def response = new URL(url).text return new JsonSlurper().parseText(response) } def getJenkinsMessage(msg) { def url = "${jenkinsUrl}/job/${jobName}/${buildNumber}/api/json" def items = getJson(url)['changeSet']['items'] items.eachWithIndex() { obj, i -> msg += obj['msg'] + ' ' } return msg }
  2. deploygate { userName = ownerName token = myToken apks {

    example { sourceFile = file(“build/outputs/apk/hoge.apk") //Below is optional if(buildNumber != null) { String msg = "B${buildNumber} " message = getJenkinsMessage(msg) } } } }