Aha, I found an (alternative) simple solution! In the job config...

*Build Environment*
X Inject environment variables to the build process
Properties File Path C:\pathtofile\mapping.properties
Properties Content THEME_NAME=${${PROJECT_NAME}}

Thanks Eric for your reply that led me to the idea.

On Friday, January 8, 2016 at 10:26:59 AM UTC-8, Marty Mickelson wrote:
>
> I asked this in StackOverflow but thought this might be a more targeted 
> place to get an answer...
>
> I have a parameterized job where I need to set an environment variable 
> based on a choice parameter the user chooses. Each project has a theme 
> project dependency. I'd like to have the user choose the project and then 
> load the theme name from a property file. Something like
>
> proj1=theme1
> proj2=theme2
> proj3=theme3
>
> If the user chooses proj1 from the PROJECT_NAME choice parameter, I want 
> to automatically set THEME_NAME to be theme1. What would be the best way 
> to go about this?
>
> I don't want to modify the Jenkins job config whenever a new project is 
> added. Instead, I want to have the mapping in a file so I can have it in 
> version control.
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/829e55eb-d9f8-4fea-9996-533c6f62ca1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to