Skip to content

Commit

Permalink
Add configuration for Git user using jenkins CLI.
Browse files Browse the repository at this point in the history
I think we'll want to start using the Jenkins CLI for managed
configuration of plugins. It's the recommended config management
solution for multiple plugins and if I can figure out how to use the
Jenkins puppet module to run Groovy script files rather than inline
scripts we'll be even better off.

This change resolves #148
  • Loading branch information
nuclearsandwich committed Sep 8, 2017
1 parent 081b820 commit 30c7a91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions modules/profile/manifests/jenkins/master.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

### Jenkins Plugins

# config for gitscm
jenkins::cli::exec { 'configure_git_user':
# semicolons are needed because the lines are joined with spaces rather than newlines.
command => [
'def gitscm_config = Jenkins.getInstance().getDescriptor("hudson.plugins.git.GitSCM");',
'gitscm_config.setCreateAccountBasedOnEmail(false);',
'gitscm_config.setGlobalConfigName("jenkins");',
'gitscm_config.setGlobalConfigEmail("[email protected]");',
'gitscm_config.save();',
]
}

# config for audit-trail
file { '/var/lib/jenkins/audit-trail.xml':
mode => '0640',
Expand Down

0 comments on commit 30c7a91

Please sign in to comment.