charts icon indicating copy to clipboard operation
charts copied to clipboard

InitScripts doesn't work

Open fznx-io opened this issue 7 years ago • 2 comments

Is this a request for help?: Yes

What happened: I want to add some command to Jenkins Master. But no changes in my jenkins master, still no init script in my jenkins master container What you expected to happen: Container run the scripts every pods restart

How to reproduce it (as minimally and precisely as possible): I added like this : InitScripts: - sh "apt update" - sh "apt install vim"

fznx-io avatar Feb 07 '19 06:02 fznx-io

You can check this code to see where the InitScripts are used: https://github.com/helm/charts/blob/master/stable/jenkins/templates/config.yaml#L255-L258

You can only provide groovy scripts here. They are executed by Jenkins during startup.

  • Post-initialization script
  • This repo contains some examples for init scripts: https://github.com/buildit/jenkins-startup-scripts/tree/master/scripts/scripts

Many issues / PRs in this repository contain the chart name as prefix in the title [stable/jenkins]. That makes it easier to see to which chart the issue belongs.

torstenwalter avatar Feb 11 '19 23:02 torstenwalter

@foosome Did you switch to using Groovy for the script as @torstenwalter mentioned?

e.g. something like

InitScript: my-script-here: |- import jenkins.model.* groovy_code_here()

sellers avatar Feb 25 '19 17:02 sellers