Reputation: 151
I am a novice to Jenkins administration, trying to help a friend set up Jenkins for his startup.
I know there are plugins in Jenkins but not quite familiar on how to achieve his requirements.
He has a spring
application which uses dispatcher.xml
to reference jdbc.properties
(one for each environment eg: jdbc_dev
, jdbc_test
, jdbc_prod
.
How do I setup environment variables in Jenkins so the respective jdbc.properties
is picked when the war file is built ?
Upvotes: 1
Views: 560
Reputation: 1507
I think following plugins will help your friend a lot.
1) EnvInject Plugin:- To inject environment variables depending on the requirements.
2) Role strategy :- To manage authorization and permissions of various users. For eg: Admin,Tester,Developer,guest.
For more info on configuration on this plugin read this Answer
3) JobConfigHistory Plugin:- To revert changes if you screw anything.
Hope it helps.
Upvotes: 1
Reputation: 14762
See Parameterized Build:
Sometimes, it is useful/necessary to have your builds take several "parameters".
...
The parameters are available as environment
parametersvariables. So e.g. a shell ($FOO, %FOO%) or Ant (${env.FOO}) can access these values.
[Corrections by me.]
See also the Matrix Project Plugin:
A multi-configuration project is useful for instances where your builds will make many similar build steps, and you would otherwise be duplicating steps.
Upvotes: 0