@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.1.2') import org.apache.http.client.methods.* import org.apache.http.impl.client.* import groovy.json.* httpclient = new DefaultHttpClient() // Jenkinsのジョブを実行する jobname = "test1" token = "MY_TOKEN" method = new HttpGet("http://localhost:8080/job/${jobname}/build?token=${token}") response = httpclient.execute(method) println response.getStatusLine().getStatusCode() response.getEntity().getContent().text
動作環境
groovy 1.8.4, JDK7 Update1, Jenkins 1.445
0 件のコメント:
コメントを投稿