Perform jenkins build on local files

邮差的信 提交于 2019-12-13 07:42:11

问题


We have a Jenkins server where I have already defined my job. It uses Perforce as SCM.

I would like to replicate all the steps that Jenkins takes to build the project but use the files in my local workspace instead. Basically, I would like to run a jenkins build locally based on a job defined on another server.

How would I do the same?


回答1:


Something like what I created for my Perforce users might work for you -- I added a job in Jenkins that will grab shelved files (so, the user would need to shelve the files), create a build from there, then let the user know if it was successful (they also have the option of running tests or creating a deployable build). The gist of it is to request the shelved changelist #, then do this: "p4 unshelve -s %SHELVEDCL% " and proceed as usual. They use it when they feel like it; it's been useful. But it does require access to Jenkins.




回答2:


1) Install Jenkins on your local workstation (if you have no already done so).

2) Copy the /Jenkins/jobs/ directory to the /Jenkins/jobs/ directory on your local workstation.

3) Fire it up and edit the Perforce workspace (and any other settings) as necessary.




回答3:


IMO, you should probably takes these steps:

  1. Create a new Jenkins job from the existing one. 2) Modify the job to be a string "parameterized" job where you pass branch-name as the parameter. You can do using "This build is parameterized" option in the configuration of the job. 3) Under the configuration of the job, for Source Code Management section, change the Branch Specifier to use the String Parameter variable name (created from #2 above). 4) Create your feature branch on Perforce and make intended changes there. 5) Run the newly created job with your branch as the parameter to it.

Hope this helps.



来源:https://stackoverflow.com/questions/34052044/perform-jenkins-build-on-local-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!