hudson-api

Set Hudson Build Description via Web API

◇◆丶佛笑我妖孽 提交于 2020-01-14 09:42:28
问题 I have a Python script that operates on Hudson builds and would love to be able to set the description of a build programmatically. I can click "Add Description" on a build's page and fill in the form, how can I POST some data to the same URL that form does? 回答1: Figured it out, need to POST the following as form data (content type application/x-www-form-urlencoded ) to http://myserver/hudson/job/thebuild/10/submitDescription {"description": "Some Description for the build"} In code: def set

Set Hudson Build Description via Web API

♀尐吖头ヾ 提交于 2020-01-14 09:42:12
问题 I have a Python script that operates on Hudson builds and would love to be able to set the description of a build programmatically. I can click "Add Description" on a build's page and fill in the form, how can I POST some data to the same URL that form does? 回答1: Figured it out, need to POST the following as form data (content type application/x-www-form-urlencoded ) to http://myserver/hudson/job/thebuild/10/submitDescription {"description": "Some Description for the build"} In code: def set

Hudson failing to start

▼魔方 西西 提交于 2020-01-05 12:28:49
问题 I had hudson running on windows server successfully. needed to restart the hudson service. After restart i am getting below error. Any idea, or if anybody experienced this issue. org.jvnet.hudson.reactor.ReactorException: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:246) at hudson.model.Hudson.executeReactor(Hudson.java:719) at hudson.model.Hudson.<init>(Hudson.java:616) at org.eclipse

How to get a better performance from Hudson CI API?

人盡茶涼 提交于 2019-12-24 00:27:23
问题 I'm trying to write a little tool for myself that would integrate with Hudson build server. The current roadblock that I've hit is performance. I'd like to do a simple thing like have a list of all jobs and the times of last successful build. The hudson API provides this information, but I either have to query everything at depth=2 or query each job individually (there's 150 of them currently). Even with exclude either approach takes over half a minute. This is unacceptable for a UI that

HUDSON: How to stop hudson job from command line?

家住魔仙堡 提交于 2019-12-18 03:37:07
问题 I need to forcefully stop a Hudson build running in remote server. Is there a command/API to do that? for ex: to trigger a new build we can do :- HUDSON_URL/job/JOBNAME/build looking for similar API to stop the build. 回答1: You should be able to make a http request to http://HUDSON_URL/job/JOBNAME/BUILDNUMBER/stop and you can do a xpath request to get the build number http://HUDSON_URL/job/JOBNAME/api/xml?xpath=//lastBuild/number/text() There may be a way to put in latestBuild or lastBuild

How can i send data to the logger from FileCallable back to master in a Jenkins plugin?

若如初见. 提交于 2019-12-11 18:11:46
问题 I'm using the following example from here: void someMethod(FilePath file) { // make 'file' a fresh empty directory. file.act(new Freshen()); } // if 'file' is on a different node, this FileCallable will // be transferred to that node and executed there. private static final class Freshen implements FileCallable<Void> { private static final long serialVersionUID = 1; @Override public Void invoke(File f, VirtualChannel channel) { // f and file represent the same thing f.deleteContents(); f

How to programmatically add a job to a view in hudson

元气小坏坏 提交于 2019-12-10 17:15:17
问题 I have a Java program controlling automatically generated jobs for a set of hudson servers. It is no problem to create, delete or update job(config)s using the hudson remote API. I also managed it to create hudson views and to create a new job for a hudson view. But I still need to know how to add an already existing job to a view and how to remove it again. Are there URLs with arguments doing the job (like for the job creation)? 回答1: You can execute a groovy script through the Hudson CLI API

Showing exception while connecting slave to master using headless jnlp

Deadly 提交于 2019-12-10 15:27:38
问题 i am using jenkins 1.447.2 version.My master is linux and slave is windows Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener <init> INFO: Hudson agent is running in headless mode. Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Locating server among [http://10.10.1.162:8080/jenkins/, http://dem Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp.Main$CuiListener status INFO: Connecting to demo.sigmainfo.in:8050 Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp

how to cancel build queue jobs in jenkins, which are not started by jenkins and are in its build queue through REST API

ε祈祈猫儿з 提交于 2019-12-06 09:17:08
问题 how to cancel build queue jobs in jenkins through REST API, which are not started by jenkins and are in its build queue. I know how to cancel the in-progress job with below command curl -X POST <jenkins-server>/job/<job-name>/<build-number>/doDelete 回答1: To cancel a job in the queue, you can POST: http://jenkins/queue/cancelItem?id=x To find x, you can parse the result of: http://jenkins/queue/api/json?tree=items[id,task[name]] To cancel a build that is in progress: http://jenkins/job/

How to access Hudson job1 artifacts from another job2?

喜欢而已 提交于 2019-11-30 20:20:15
We have a production job and a nightly job for a project in Hudson. The production job needs to pull off some artifacts from a specific nightly build # (which is provided as parameter). Can anyone help us with a hint on how to achieve this? The Copy Artifact plugin seems to be capable of doing this. Another approach could be to fetch the artifact via http://server/jobs/job1/[build #]/artifacts/ You can use "Build Environment" configuration tools in the job's configuration page. Tick the Configure M2 Extra Build Steps box and add an Execute Shell which grep things from the desired artifact. We