Quantcast

Is there a way to automatically put working directories elsewhere?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Is there a way to automatically put working directories elsewhere?

Qazwart-2
I am planning on setting up a new Jenkins server at our company. I
want to keep all deployable artifacts in Jenkins for a wide variety of
reason (easy access, access control, etc.).

The company would prefer if these deployable artifacts were kept on a
NAS for backup reasons.

I am sure that wouldn't be an issue with Jenkins. The only issue is
one of speed. Jenkins would be doing the checkout remotely, and then
compiling the remote source files. That could slow things down quite a
bit. Most builds are pretty fast, with in a few minutes, so it's not a
terrible concern. If a job is really problematic, I could configure it
to use a local working directory. However, I can see this really
increasing the maintenance. For example, imagine a job I configure on
the NAS and use a particular directory for local storage. The
developers branch the project and now want a Jenkins job for that
branch. I copy the old Jenkins job, change the checkout URL and a few
other things, but forget the local working directory. Now, I have two
jobs using the same local working directory.

It would be nice if Jenkins could be configured, so that the working
directory is automatically put elsewhere. That way, when I create a
job, Jenkins would simply put the working directory in local storage
for me. For example, I configure a job /mnt/nas/jenkins/jobs/foo. All
directories would be on the NAS, but the working directory would be on
/opt/local/jenkins/foo or /opt/local/jenkins/jobs/foo. (I really don't
care as long as local working directories are unique). Is there any
way to set Jenkins up to do this? Is there a plugin that can do this?

--
David Weintraub
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a way to automatically put working directories elsewhere?

Sami Tikka
Did you try going to global configuration and clicking on the first Advanced button? It reveals two new settings that should do what you want.

-- Sami

David Weintraub <[hidden email]> kirjoitti 30.7.2012 kello 20.58:

> I am planning on setting up a new Jenkins server at our company. I
> want to keep all deployable artifacts in Jenkins for a wide variety of
> reason (easy access, access control, etc.).
>
> The company would prefer if these deployable artifacts were kept on a
> NAS for backup reasons.
>
> I am sure that wouldn't be an issue with Jenkins. The only issue is
> one of speed. Jenkins would be doing the checkout remotely, and then
> compiling the remote source files. That could slow things down quite a
> bit. Most builds are pretty fast, with in a few minutes, so it's not a
> terrible concern. If a job is really problematic, I could configure it
> to use a local working directory. However, I can see this really
> increasing the maintenance. For example, imagine a job I configure on
> the NAS and use a particular directory for local storage. The
> developers branch the project and now want a Jenkins job for that
> branch. I copy the old Jenkins job, change the checkout URL and a few
> other things, but forget the local working directory. Now, I have two
> jobs using the same local working directory.
>
> It would be nice if Jenkins could be configured, so that the working
> directory is automatically put elsewhere. That way, when I create a
> job, Jenkins would simply put the working directory in local storage
> for me. For example, I configure a job /mnt/nas/jenkins/jobs/foo. All
> directories would be on the NAS, but the working directory would be on
> /opt/local/jenkins/foo or /opt/local/jenkins/jobs/foo. (I really don't
> care as long as local working directories are unique). Is there any
> way to set Jenkins up to do this? Is there a plugin that can do this?
>
> --
> David Weintraub
> [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a way to automatically put working directories elsewhere?

Les Mikesell
In reply to this post by Qazwart-2
On Mon, Jul 30, 2012 at 12:58 PM, David Weintraub <[hidden email]> wrote:

> I am planning on setting up a new Jenkins server at our company. I
> want to keep all deployable artifacts in Jenkins for a wide variety of
> reason (easy access, access control, etc.).
>
> The company would prefer if these deployable artifacts were kept on a
> NAS for backup reasons.
>
> I am sure that wouldn't be an issue with Jenkins. The only issue is
> one of speed. Jenkins would be doing the checkout remotely, and then
> compiling the remote source files. That could slow things down quite a
> bit. Most builds are pretty fast, with in a few minutes, so it's not a
> terrible concern. If a job is really problematic, I could configure it
> to use a local working directory. However, I can see this really
> increasing the maintenance. For example, imagine a job I configure on
> the NAS and use a particular directory for local storage. The
> developers branch the project and now want a Jenkins job for that
> branch. I copy the old Jenkins job, change the checkout URL and a few
> other things, but forget the local working directory. Now, I have two
> jobs using the same local working directory.
>
> It would be nice if Jenkins could be configured, so that the working
> directory is automatically put elsewhere. That way, when I create a
> job, Jenkins would simply put the working directory in local storage
> for me. For example, I configure a job /mnt/nas/jenkins/jobs/foo. All
> directories would be on the NAS, but the working directory would be on
> /opt/local/jenkins/foo or /opt/local/jenkins/jobs/foo. (I really don't
> care as long as local working directories are unique). Is there any
> way to set Jenkins up to do this? Is there a plugin that can do this?

Are you building everything on the jenkins host?    Why not do builds
on slaves (even on the same host if necessary), and tell jenkins to
archive the build artifacts you want?   Then you can mount the NAS
storage wherever jenkins puts the artifacts without affecting builds -
or requiring the normally disposable workspaces to be on the NAS.

--
   Les Mikesell
     [hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a way to automatically put working directories elsewhere?

Qazwart-2
In reply to this post by Sami Tikka
On Mon, Jul 30, 2012 at 2:53 PM, Sami Tikka <[hidden email]> wrote:
> Did you try going to global configuration and clicking on the first Advanced button? It reveals two new settings that
> should do what you want.

Boy that's new! I just downloaded Jenkins to see what you're talking
about. Yes, this does exactly what I want. I can specify build
directories on the local machine.

The other advanced option, Build Record Root Directory, is intriguing
too. I take it that this puts everything except for the builds
directory (which I assume would include the saved artifacts) to
another folder while keeping everything else on the local build
machine. With this, I could specify the NAS for the Build Record Root
Directory.

I'll have to play around with both of these.

--
David Weintraub
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a way to automatically put working directories elsewhere?

Qazwart-2
In reply to this post by Les Mikesell
On Tue, Jul 31, 2012 at 1:26 AM, Les Mikesell <[hidden email]> wrote:
> Are you building everything on the jenkins host?    Why not do builds
> on slaves (even on the same host if necessary), and tell jenkins to
> archive the build artifacts you want?   Then you can mount the NAS
> storage wherever jenkins puts the artifacts without affecting builds -
> or requiring the normally disposable workspaces to be on the NAS.

Unfortunately, I don't have any slaves now. However, I never knew I
could have the machine itself as a slave. Interesting idea...

However, it looks like there are two fairly new Jenkins options that
do what I would want. I can specify where to put the working directory
or the build storage separate from the jobs directory. If that doesn't
work, I'll do the slave setup.

--
David Weintraub
[hidden email]
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Is there a way to automatically put working directories elsewhere?

Les Mikesell
On Tue, Jul 31, 2012 at 2:41 PM, David Weintraub <[hidden email]> wrote:
>
> Are you building everything on the jenkins host?    Why not do builds
>> on slaves (even on the same host if necessary), and tell jenkins to
>> archive the build artifacts you want?   Then you can mount the NAS
>> storage wherever jenkins puts the artifacts without affecting builds -
>> or requiring the normally disposable workspaces to be on the NAS.
>
> Unfortunately, I don't have any slaves now. However, I never knew I
> could have the machine itself as a slave. Interesting idea...

Jenkins doesn't particularly care where a slave runs as long as you
can get it connected (and ssh is easy).

> However, it looks like there are two fairly new Jenkins options that
> do what I would want. I can specify where to put the working directory
> or the build storage separate from the jobs directory. If that doesn't
> work, I'll do the slave setup.

As long as you are archiving what you want to keep and not using the
workspaces directly it probably doesn't matter.

--
  Les Mikesell
     [hidden email]
Loading...