I want to build periodically with environment variable in jenkins:
#pseudo setting
H 17 * * * BUILD_FOR=gist-mail TOKEN_GIST_MAIL=some_token
H 17 * * * BUILD_FOR=pollyanna TOKEN_POLLYANNA=anothor_token
H 17 * * * BUILD_FOR=fenix-knight TOKEN_FENIX_KNIGHT=alternative_token
These variables do not change dynamically, given in advance.
I got a error below:
Invalid input: "10 17 * * * BUILD_FOR=fenix-knight": line 1:12: expecting EOF, found ' '
How do I pass different environment variable to each build trigger? My work around is create each jobs.
My executing shell below:
gem install bundler
ruby -i -pe '$_.gsub! /^ruby/, "#ruby"' Gemfile
bundle
BUILD_FOR=fenix-knight bundle exec rake tachikoma:load tachikoma:fetch tachikoma:bundle tachikoma:pull_request
There is a parameterized build plugin for your situation Jenkins - triggering a parameterized build has a good demonstration of how to use it and also another plugin to show the parameters which went into it.
You could also look at the multijob plugin https://wiki.jenkins-ci.org/display/JENKINS/Multijob+Plugin to run one underlying job with separate parameters
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With