문제

I have renamed a Jenkins Job from the Jenkins GUI. I changed the Project name in the Configure menu and hitting Save afterwards.

  • However the workspace name for this Jenkins job has not been changed. What I am finding is upon the job execution a new workspace is getting created with this given new name and none of the contents of the old workspace is getting copied.

  • So the issue is contents of the old workspace is not copied to the new workspace.

What should I do instead?

I know there are several questions in SO in this area. However those do not answer my question.

Renaming job in jenkins/hudson

Rename a job in Jenkins

So please check this before marking this question as a duplicate.

도움이 되었습니까?

해결책

I was able to workaround this is issue using the Use custom workspace option.

To change this location, I need to choose configure job and click on the Advanced button in the Advanced Project Options section.

After opening the settings, you will find some more configuration options for your job. Look for the Use custom workspace option on the right hand side and check the box.

Reference: Jenkins: Change Workspaces and Build Directory Locations

다른 팁

Workspaces are volatile by nature and may reside on a build node which has gone offline, therefore your build job should not rely on files being present in the workspace. However sometimes you will benefit from a speed-up by reusing unchanged files existing in workspace and decide not to clean them.

When you start a build, a new workspace is (as you noted) created, this is the correct behaviour, you should not need to store files in your workspace between builds but set up your system to load all sources from your vcs. This way you will always be able to make a fresh build from source, there are also a few options available to clear the workspace from old files.

If you do not want to populate the workspace from a source code addon you can always use the custom shell script feature to run a few shell commands to copy the needed files.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top