Variables from variables and replacing forward slash with backslash

73 views
Skip to first unread message

Aki K

unread,
Mar 23, 2016, 9:30:25 AM3/23/16
to Jenkins Users
Hello

I want to make variables from a variable that is in format of "projectname/projectfolder"

$PROJECT=projectname/projectfolder

is gotten as a environment variable from the trigger

I want to declare two other variables from this in this format:

$PROJECT_BS=projectname\projectfolder
$PROJECT_ID=projectname_projectfolder

How to do this? I've been googling for 2-3 hours now and cannot find answer for this.

I'm not a programmer but I do know how to do this in Windows batch file.

Jenkins is very nice but the documentation is A BIT lacking.


Eric Pyle

unread,
Mar 23, 2016, 11:52:09 AM3/23/16
to jenkins...@googlegroups.com
Hi,

You say you know how to do this in a Windows batch file. Are you in an "execute shell" build step? If so this is just a shell question. Where do you need to use these new variables you define? If you need to reference them in a later build step, the Envinject plugin may be helpful.

Eric
--
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/94ec5fba-996f-4e5a-880b-62c1f4e7d50a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aki K

unread,
Mar 24, 2016, 4:25:17 AM3/24/16
to Jenkins Users
Well, I was kinda hoping that no one would answer "Use Envinject" since the method of generating the variables (outside of Jenkins) to a file and then reading them from that feels ridicilous.

What I'm doing is building Unity 3D projects on different platforms and different Unity 3D versions.

And what I'm trying to achieve with these variables is to have sane names for the resulting packages, logs and folders.

I would like to have the variables for the build steps in Jenkins and used throughtout the whole job.
Reply all
Reply to author
Forward
0 new messages