Change Jenkins job workspace Change Jenkins job workspace jenkins jenkins

Change Jenkins job workspace


Under "Advanced" you can explicitly choose a working directory for the projects without changing the Jenkins home directory. Check the "Use custom workspace" box and set the directory that Jenkins will pull the code to and build in.

In our setup we wait for the build process to complete in the working directory and add a build step for Jenkins to copy (most) of the files out to the directory that serves up the website. We had issues with file locking preventing the build process if someone (e.g. the testers) were using the site.


One simple way to do it is to create a symlink under /var/www/html/ that points to your code directory, e.g.:

sudo ln -s /var/lib/jenkins/jobs/"Code Deployement" /var/www/html/[project-name]