In Hudson, how do I set multiple environment variables given a single parameter? -


i want set parameterized build in hudson takes 1 parameter -- type of build create (qa, stage, production). however, each of builds requires several different environment variables set. (pseudocode):

if ${config} == "qa"     ${svn_path} = "branches/dev"     ${build_config} = "debug"     # more environment variables... else if ${config} == "production"     ${svn_path} = "trunk"     ${build_config} = "release"     # more environment variables... else # more build configurations... end if 

there myriad steps in our build -- pull subversion, run combination of msbuild commands, dos batch files, , powershell scripts.

we typically schedule our builds hudson interface, , want parameter entry idiot-proof possible.

is there way this?

since many things release, how scripting steps outside of hudson. can use ant, batch files, or whatever scripting language prefer. put script in scm revision control.

pro's:

  • you logic out of hudson, since hudson calls script.
  • you don't need create environment variables need persisted between shells (global variables).
  • you can use config/properties files every environment, should put version control
  • you can run these scripts outside of hudson, if need to
  • hudson job config get's way easier
  • you don't have side effects of changing global environment variables. should try create jobs don't change global settings, because calls trouble.

Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -