3 ms·
FWIW, if you fight through the "undocumented features," Jenkins actually ends up being one of the best tools out there to manage via Ansible or whatnot. The Gro
by karlmdavis 10y ago
FWIW, if you fight through the "undocumented features," Jenkins actually ends up being one of the best tools out there to manage via Ansible or whatnot. The Groovy/Java API for Jenkins is incredibly powerful, and by adding Groovy scripts to the /var/lib/jenkins/init.groovy.d/ directory, you can configure just about anything.
Maybe this will be helpful? Here's the Ansible config I've built for a Jenkins deployment I manage: https://github.com/HHSIDEAlab/hhsdevcloud-ansible/tree/master/roles/jenkins https://github.com/HHSIDEAlab/hhsdevcloud-ansible/tree/maste.... Most of the "meat" is in the Groovy scripts in the templates/ directory there.
- vorg 10y agoApache Groovy also has "undocumented features", e.g. from your scripts: matchingSecret = secrets.find { secret -> secret.id == id } can be written as: matchingSecret = secrets.find { it.id == id } Those scripts look fairly basic, without any looping. Perhaps Java 8 with lambdas, or Kotlin could be used instead.
- dmux 10y agoFor more about this, see the documentation relating to the "implicit parameter"[0] [0] http://groovy-lang.org/closures.html#implicit-it http://groovy-lang.org/closures.html#implicit-it