envinject plugin: should it be able to set the workspace?

88 views
Skip to first unread message

Martin d'Anjou

unread,
Oct 23, 2015, 10:55:08 AM10/23/15
to Jenkins Users
A while ago, I was able to use the envinject plugin to set the workspace path, but it does do that anymore. I wish I could control the workspace location for two reasons:
1) I need to share workspaces between jobs because of the large volume of data being produced (archiving is not practical)
2) Gradle is unable to continue a build when the absolute path to the build output changes.

Q) Is the envinject supposed to be able to control the workspace location?

Thanks,
Martin

Ginga, Dick

unread,
Oct 23, 2015, 11:08:22 AM10/23/15
to jenkins...@googlegroups.com

Martin, while the envinject plugin will let you set environment variables that you might be able to use to point to some other folder than the job’s default workspace, you might be able to use the Use Custom Workspace option under Advanced Project Options:

 

For each job on Jenkins, Jenkins allocates a unique "workspace directory." This is the directory where the code is checked out and builds happen. Normally you should let Jenkins allocate and clean up workspace directories, but in several situations this is problematic, and in such case, this option lets you specify the workspace location manually.

One such situation is where paths are hard-coded and the code needs to be built on a specific location. While there's no doubt that such a build is not ideal, this option allows you to get going in such a situation.

--
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/3c39a5e5-0df0-4756-bc43-f99430a44564%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Krishna Kumar Tiwari

unread,
Oct 28, 2015, 3:17:00 AM10/28/15
to Jenkins Users
One use of envlnject which i have used
Create a standard java .properties file and you can fetch the environmental variable and these can be used during your job. you need to specify the properties file in your job configuration. 
One way to do it copy the properties file from your slave node/master node to $WORKSPACE.

cp /root/build.properties $WORKSPACE/ 

here build.properties file is the standard java  properties file. 

Martin d'Anjou

unread,
Oct 31, 2015, 7:26:49 AM10/31/15
to Jenkins Users
On Friday, October 23, 2015 at 11:08:22 AM UTC-4, rginga wrote:

Martin, while the envinject plugin will let you set environment variables that you might be able to use to point to some other folder than the job’s default workspace, you might be able to use the Use Custom Workspace option under Advanced Project Options:


I use EnvInject to compute the location of the workspace, this is injected as a variable which I use in the Custom Workspace option. I wish the Workflow would accept variables from EnvInject as I need to set the workspace before the Git Plugin jumps into action.
Reply all
Reply to author
Forward
0 new messages