jenkins-cli

How can I set Jenkins build description while triggering build via curl?

无人久伴 提交于 2019-12-09 16:37:52
问题 I'm trying to set the build description of a build I'm triggering, as I'm kicking off the build, and I have no luck so far. I came across a solution (Adding text to the page of a build triggered by the Jenkins remote API), and I kind of got it to work this way (first command will kick off the build, second one will set the description of the last build): curl -v -X POST "http://[myServer]/job/[jobName]/build" curl -v -X POST "http://[myServer]/job/[jobName/lastBuild/submitDescription" --data

How can I get jenkins-cli.jar to use my ssh agent/keychain?

你离开我真会死。 提交于 2019-12-09 06:19:21
问题 I'm using the jenkins-cli.jar file from my jenkins server, and on every run it prompts me for my ssh key passphrase. I'd like it to use my ssh keychain so I don't have to enter it on every invocation. If it matters, I'm on OSX using the default keychain setup, I don't have a manual ssh-agent configured right now. 回答1: Jenkins CLI client does not support SSH agents for now. As a workaround, you can generate dedicated key without passphrase, associate it with your Jenkins account and instruct

Using the jenkins CLI (on fedora 23)

纵然是瞬间 提交于 2019-12-08 12:57:55
问题 I have a jenkins instance running. To create this instance on a Fedora 23 machine, I installed jenkins (via dnf) and started it (via systemd). It is running and I can see it in my browser at http://localhost:8080. I have been trying to follow the directions in https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI. I download http://localhost:8080/jnlpJars/jenkins-cli.jar to my computer. Then I try to run the program java -jar jenkins-cli.jar http://127.0.0.1 -s help and I get no main

jenkins cli with checkout Subversion using groovy script

我怕爱的太早我们不能终老 提交于 2019-12-08 06:35:58
问题 Is there a way to check out any Subversion project using Jenkins-Cli by executing a groovy script on the master? I can get to the point of creating SVN client manager[org.tmatesoft.svn.core.wc.SVNClientManager], but can't really understand how to employ that in checking out an SVN project from the URL. 回答1: After a lot of hit and trials I have come up with this, might be useful for someone else: import jenkins.*; import jenkins.model.*; import hudson.*; import hudson.model.*; import hudson

Query for last successful build number in Jenkins with change

五迷三道 提交于 2019-12-07 02:30:22
问题 Example: 32 - fail 31 - stable no change (triggered by parent) 30 - stable with changes 29 - fail ... I want a query to return 30 So far what I got: To query the last stable build number: http://jenkins/job/project_name/lastStableBuild/buildNumber This returns 31 . Not exactly what I need. To check if this build has changes, the only way I know is : http://jenkins/job/project_name/31/api/json Then I need to go inside the huge JSON and check if any item in changeSet > items. Is there a easier

gitlab 6.0.2 Jenkins CI services not showing

a 夏天 提交于 2019-12-06 22:52:19
问题 I have a gitlab server version "Gitlab 6.0.2 10b0b8f". I want to connect "Jenkins CI" for build purpose. for this I am following - http://doc.gitlab.com/ee/integration/jenkins.html .But In a project services I am not able to see "Jenkins CI". Only I can See "Gitlab CI". Can you please help me. Any example will be appriciated. 回答1: Solved. Jenkins CI support is only included in the Enterprise version (EE). gitlab server version "Gitlab 6.0.2 10b0b8f" is not a enterprise edition. so it is not

jenkins cli with checkout Subversion using groovy script

蹲街弑〆低调 提交于 2019-12-06 21:44:41
Is there a way to check out any Subversion project using Jenkins-Cli by executing a groovy script on the master? I can get to the point of creating SVN client manager[org.tmatesoft.svn.core.wc.SVNClientManager], but can't really understand how to employ that in checking out an SVN project from the URL. After a lot of hit and trials I have come up with this, might be useful for someone else: import jenkins.*; import jenkins.model.*; import hudson.*; import hudson.model.*; import hudson.slaves.SlaveComputer; import hudson.scm.SubversionSCM; import hudson.remoting.Channel; import hudson.FilePath;

How to change a Git URL in all Jenkins jobs

一笑奈何 提交于 2019-12-06 03:11:26
I have more than 100 jobs in Jenkins and I have to change a Git URL in each and every job since we changed the git server. I must traverse each job and change the Git URL. Can anyone help me with a groovy script? I was able to traverse each job, but not able to get the Git URL or change it: import hudson.plugins.emailext.* import hudson.model.* import hudson.maven.* import hudson.maven.reporters.* import hudson.tasks.* // For each project for(item in Hudson.instance.items) { println("JOB : " + item.name); } I badly need help in this, please someone help me. The script below will modify all Git

How to remove old builds in jenkins? [duplicate]

淺唱寂寞╮ 提交于 2019-12-06 02:50:08
问题 This question already has answers here : Jenkins: remove old builds with command line (9 answers) Closed 4 years ago . I removed old build folders from the build directory in Jenkins expecting them to be removed in the UI, unfortunately whilse these build directories are gone, their UI link still exists. I now have two questions 1) How can I get rid of the defunct links in the UI? 2) How can I delete old build from cli and have it reflected in the UI? 回答1: You must either restart Jenkins or

Getting an IP Address through Jenkins REST API?

泪湿孤枕 提交于 2019-12-05 10:22:11
I've been tasked with instituting some health checking on some Jenkins jobs. The idea is to get the job's status and an associated IP address through the Jenkins rest API, so I can use that information to interface with another restful API. I have created a groovy script that successfully parses through the Jenkins jobs and gets their status (whether or not they are running) but I have yet to find a way to associate these jobs with their IP addresses. Is there any way to get the IP address of a slave in Jenkins through the rest API, and if not, is there another way to get said IP address? Here