Create work in Jenkins automatically when repo is created in Phabricator

I have a repo in phabricator and cloned on my local machine.

Now I want to create a new Jenkins job automatically after creating a new repo in Phabricator. Jenkins API is available to create a new job remotely.

According to Jenkins:

To create a new job post config.xml to this url with query parameter = JOBNAME. You need to send the header Content-Type: application / xml.

I can create an assignment using the command terminal

.

curl -X POST -H "Content-Type:application/xml" -d "<project><builders/><publishers/><buildWrappers/></project>" "http://ip:port/createItem?name=AA_TEST_JOB1" 

      

Question: How can I run the Harbormaster command to create a Jenkins job and also submit a file config.xml

to configure this new job?

+3


source to share


2 answers


  • In fact, there is no setup or automatic way to create Jenkins job after creating a new repo in Phabricator.

  • I decided to change the Phabricator php codes. The easy way is to call Jenkins API from php codes after creating repo.



0


source


Guy Warner ( http://www.guywarner.com/ ) has done a great job of showing how this is possible. You can visit his blog post for more details: http://www.guywarner.com/2014/05/integrating-jenkins-and-phabricator.html (part 1) and http://www.guywarner.com/ 2014/06 / part-2-integrating-phabricator-and.html (part 2).

The basic idea is that your Harbormaster build plan will make an HTTP request to your Jenkins instance.



We used his tutorials to customize nearly 100 presets that are launched from Phabricator based on various types of changes.

+1


source







All Articles