Workspace root directory (Jenkinsfile)

1,429 views
Skip to first unread message

Ryan Hutchison

unread,
Feb 21, 2017, 10:38:01 AM2/21/17
to jenkins...@googlegroups.com
My JENKINS_HOME is C:\Program Files (x86)\Jenkins

I have allocated a separate drive for my workspace `D:\` and modified the global workspace property to reflect this new location.

When my build job runs (Jenkinsfile), it always goes to ${JENKINS_HOME}\workspace.

My issue is that msbuild ends up failing due to long file names/paths.  It does not help that the randomly generated ${ITEM_FULLNAME} is quite long by itself.

Any thoughts or pointers would be appreciated.

Spriggs, Jim

unread,
Feb 21, 2017, 11:04:49 AM2/21/17
to jenkins...@googlegroups.com

Hi Ryan,

 

Been there.

 

How about setting your JENKINS_HOME to something shorter before you start the jenkins server?

 

For instance, this works for me:

 

                JENKINS_HOME=”/jk”  java  -jar  jenkins.war

 

[ Obviously, I enjoy the luxury of a sensible OS. ;-) ]

 

See the notes at the top of the “Manage Jenkins|Configure System” page for more info.

 

Good Luck!

--

jim

--
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/CAFFG4vjXshWaTHe7hzuqDw890Q20DU2zS01pf3DVeQGSubvPbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.




RAYLASE AG
Argelsrieder Feld 2+4
82234 Wessling
Germany
Tel.: +49-(0)8153/88 98-0
Fax: +49-(0)8153/88 98-10
http://www.raylase.de

District Court Munich, HRB 131450

Board: Dr. Philipp Schön (Chairman), Berthold Dambacher, Christoph von Jan

Supervisory Board: Dr. Ulrich Lohmann (Chairman)


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

jer...@bodycad.com

unread,
Feb 21, 2017, 12:13:53 PM2/21/17
to Jenkins Users
What I have found so far:

Inside the Jenkins management you can change the Workspace directory. 

  1. http://MY_HOST/Jenkins/configure
  2. Right under the home directory into advanced button.
  3. Workspace Root Directory   ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}
you could change it for something short indeed like  D:/work
I had the same problems with the zip archiving under Windows. The 256 char path limits is a pain. Keep your job project short, use description for more info. Try to avoid too many job folder under Windows since it does create 2 folder deep /job/name every time.

Ryan Hutchison

unread,
Feb 21, 2017, 1:39:48 PM2/21/17
to Jenkins Users
I have changed the Workspace Root Directory, but it seems like if you're using Pipeline As Code / Jenkinsfile, it ignores this variable.

Jérôme Godbout

unread,
Feb 21, 2017, 1:45:38 PM2/21/17
to jenkins...@googlegroups.com
Have you try to restart the Jenkins server so it can take into account this new path? If so, which version, cause if the path is truly valid, it should work?

I have a Window server which was working fine with another drive. Just a note, if the other drive is a network drive, make sure your Jenkins services can access it (I strongly recommend avoiding this, this is a pain).

I think (if I remember well) if the path is invalid Jenkins default back to the default value for the workspace, but I might be wrong on this.

Make sure the folder exist with proper (case sensitive???)

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Us_sfZTgJgk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6e769449-4b67-4b36-8a7f-3c60f5c73fdd%40googlegroups.com.

Ryan Hutchison

unread,
Feb 21, 2017, 1:47:10 PM2/21/17
to Jenkins Users
I can map the path with SUBST, but I still end up with <driveletter>:\workspace -- ideally this could still be shorter.

I also then have to map a drive X:\ -> C:\Program Files (x86)\Jenkins and then C:\Program Files (x86)\Jenkins\workspace -> D:\ (ugh)

RE: OS, I wish I was able to share the same luxury

Ryan Hutchison

unread,
Feb 21, 2017, 1:50:40 PM2/21/17
to Jenkins Users
Thanks - I will check everything again and try to recycle the service.

I am simply mapping to D:\${ITEM_FULLNAME} - where D: is a physical disk.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.

Jérôme Godbout

unread,
Feb 21, 2017, 2:10:59 PM2/21/17
to jenkins...@googlegroups.com
The drive you see into the user account and the one a services can access are 2 different thing under Windows, try with another path on a local drive after that you will pinpoint the drive usage with the service if this work properly.

If so here some information that can be useful

net use \\10.1.1.10\mypath /savecred /user:MyUserName MyPassword

According to http://support.microsoft.com/kb/287536 try using the following instead, seem like giving the password may prevent the credential creation even if /savecred switch is given. Use * for password so the password get a prompt, it should always create the credential with that.

net use * \\10.1.1.10\mypath /savecred /user:MyUserName

Mount Drive for deamon or services

  1. download the http://technet.microsoft.com/en-us/sysinternals/bb842062.aspx
  2. install the tools
  3. open a cmd.exe
  4. type psexec -i -s cmd.exe
    1. into new shell type whoami
    2. should see: nt authority\system
    3. mount the drive with net use see above
    4. if you ever need to unmount the drive into the same psexec
    5. net use z: /delete

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/Us_sfZTgJgk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c33792b9-2540-49e9-8b95-610e6efa5ae4%40googlegroups.com.

Ryan Hutchison

unread,
Feb 21, 2017, 2:12:15 PM2/21/17
to Jenkins Users
Global configuration workspace root directory is set to D:\${ITEM_FULLNAME}

D: is a physical disk.

Service recycled.

LOG:
Running on asi-bldcn02-01 in C:\Program Files (x86)\Jenkins\workspace\i_api.asicentral.com_master-BLRHPIOJSBVARDRRLSJX5OHVKMDV5UTXULFID5BU57XXXXE37BSQ

Versions:
Jenkins 2.47
Pipeline 2.5

Setup using Github Organization/Multibranch pipeline

Jérôme Godbout

unread,
Feb 21, 2017, 2:13:47 PM2/21/17
to jenkins...@googlegroups.com
can you try d:/${ITEM_FULLNAME}

reverse the backslash just in case...

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/55d7015b-dbe2-4b71-b2b1-493a0845f183%40googlegroups.com.

Ryan Hutchison

unread,
Feb 21, 2017, 2:21:06 PM2/21/17
to Jenkins Users
I have tried d:/${ITEM_FULLNAME} - no luck

I also just tried ${JENKINS_HOME}/TEST/${ITEM_FULLNAME}

note default is: ${JENKINS_HOME}/workspace/${ITEM_FULLNAME}

I created TEST directory under jenkins home same root that workspace exists - still ignored.

Running on master in C:\Program Files (x86)\Jenkins\workspace\i_api.asicentral.com_master-BLRHPIOJSBVARDRRLSJX5OHVKMDV5UTXULFID5BU57XXXXE37BSQ

Jérôme Godbout

unread,
Feb 21, 2017, 2:53:44 PM2/21/17
to jenkins...@googlegroups.com
Humm, maybe someone from Jenkins can step in on this I'm out of idea. Else the only think I could see is permission problems for the service to write at that location and compare with the default path.

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/561732fc-76a8-4165-9459-62b44504ad7b%40googlegroups.com.

Ryan Hutchison

unread,
Feb 21, 2017, 2:57:36 PM2/21/17
to Jenkins Users
I do not believe it's an issue with permissions.

When I have worked with generic jobs, I did not have this issue.  It seems to be related to pipeline/workflow.

Hopefully someone that is familiar with the internals of pipeline can provide some assistance.

Jérôme Godbout

unread,
Feb 21, 2017, 3:35:57 PM2/21/17
to jenkins...@googlegroups.com
humm, I had a different workspace under Windows with pipeline working.

Just to make sure you don't do any cd.. or dir(){} change into your pipeline script?
Do you use the exws or exwsAllocate call?

Probably not to all the above, just in case... sorry I can't help more, good luck

bodycad
Jerome Godbout
Software Developer
2035 rue du Haut-Bord, Québec, QC, Canada. G1N 4R7
T:  +1 418 527-1388
E: jer...@bodycad.com
www.bodycad.com

The contents of this email message and any attachments are intended solely for the addressee(s) and may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited. 

Le contenu de ce message et les pièces jointes sont destinés uniquement pour le(s) destinataire(s) et peuvent contenir des informations confidentielles et / ou privilégiées qui peuvent être protégées légalement contre toute divulgation. Si vous n'êtes pas le destinataire de ce message ou son agent, ou si ce message vous a été adressé par erreur, s’il vous plaît avertir immédiatement l'expéditeur par courriel de réponse, puis supprimer ce message et les pièces jointes. Si vous n'êtes pas le destinataire prévu, vous êtes par la présente informé que toute utilisation, diffusion, copie, ou stockage de ce message ou de ses pièces jointes est strictement interdit.


To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/c28b2c20-8ad9-452d-8685-82fc6821fd45%40googlegroups.com.

Ryan Hutchison

unread,
Feb 21, 2017, 4:03:53 PM2/21/17
to jenkins...@googlegroups.com
To simplify things, I stripped down my Jenkinsfile

node {
checkout scm
}

Still: Running on master in C:\Program Files (x86)\Jenkins\workspace\ers.asicentral.com_pipeline-KZZ2FMCWP4OQDL4O6QTDBOBKZZPIXSJL4UPRWYIRJN3RJMX2S5IA

Ryan Hutchison

unread,
Feb 21, 2017, 8:03:23 PM2/21/17
to Jenkins Users

Ryan Hutchison

unread,
Feb 21, 2017, 11:45:39 PM2/21/17
to Jenkins Users
I have my local environment setup to debug.  I have no experience, so it might take some time, but so far I have noticed it works fine for Pipeline jobs, but an issue with multibranch pipelines and ultimately github orgs (uses multibranch pipelines).

I'll post my findings when I'm done.
Reply all
Reply to author
Forward
0 new messages