Same workspace for multiple jobs

2019-01-21 09:01发布

I have a job called "development" and another project called "code analysis". At the moment we have two different jobs and different workspaces, but same code; is there any way we could use the same workspace for multiple jobs?
I checked the plugins available in Jenkins but I haven't found any suitable one.

3条回答
beautiful°
2楼-- · 2019-01-21 09:12

if you were not able to find Use custom workspace you can located it under your project configure>General>Advanced>Use custom workspace

查看更多
叼着烟拽天下
3楼-- · 2019-01-21 09:19

There is a Jenkins Plugins which enables you to create a shared workplace a setup them on every job which need the files from that given repository.

Use Case:

Similar to what you need, first create two jobs from the same Git Repository, then go to "Manage Jenkins" and you create a Shared Workspace. And point to it, on every job you need to read from that files.

Jenkins Plugin

https://wiki.jenkins-ci.org/display/JENKINS/Shared+workspace+plugin#


PS: You should look into "Known Issues" could be a deal breaker for your needs.

sometimes, on fresh copied job, shared-space url parameter not saving to config on first "save", you should save job twice to be sure.

^^ This one it's still unresolved, I tried and still happens. After some several saves (just to be sure) the job runs perfectly.

查看更多
The star\"
4楼-- · 2019-01-21 09:35

Suppose your development Jenkins job workspace is /var/workspace/job1. In the code analysis job configuration page, under the tab Advanced Project Options click on Advanced and select the option Use custom workspace and give the same workspace /var/workspace/job1 as of your development job.

查看更多
登录 后发表回答