Howto change the output/workspace of a git clone job?

14 views
Skip to first unread message

Gorgonz ola

unread,
Aug 30, 2018, 11:43:33 AM8/30/18
to Jenkins Users
env: opensuse leap 15

well, I'm completely new in using jenkins. In fact I just did my first project, that only clones a specific git branch and thats it.

This works fine and the files are copied to /var/lib/jenkins/workspace.

But it is a website project, where I prefer /srv/www/htdocs/.

Where do I have to set this alternative workspace?

Any suggestions?

Mark Waite

unread,
Aug 31, 2018, 7:38:23 AM8/31/18
to jenkins...@googlegroups.com
Jenkins generally prefers that workspaces are not hard-coded locations on specific machines.  Setting a workspace as a hard-coded location causes problems like:
  • Only one build can run at a time (throughput limit)
  • Only one machine can run the build (performance limit)
  • Source repository is copied into the workspace (undesirable for websites since it risks making your site history available through your web server accidentally)
  • Accidental tool and file system dependencies are not detected because the same machine and dir is used for every build
Rather than using /srv/www/htdocs as a Jenkins workspace, you should create a "deploy step" in your build process that copies from a working directory (assigned by Jenkins automatically) to /srv/www/htdocs after all the build and verification steps are complete.

Mark Waite

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/57e3040e-0c93-48df-b87b-cfcf8b5f6db6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gorgonz ola

unread,
Aug 31, 2018, 9:29:48 AM8/31/18
to Jenkins Users
@Mark: thx a lot for Your helpful considerations. I see the point now and agree, that another deploy step is the better choice. Even more, since I have better control then - in case the build fails ;-)
Reply all
Reply to author
Forward
0 new messages