From 30c7a91de6258dee23cfa4788ebe4a9d54881db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven!=20Ragnar=C3=B6k?= Date: Wed, 30 Aug 2017 11:12:28 -0400 Subject: [PATCH] Add configuration for Git user using jenkins CLI. 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 https://github.com/ros-infrastructure/buildfarm_deployment/issues/148 --- modules/profile/manifests/jenkins/master.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/profile/manifests/jenkins/master.pp b/modules/profile/manifests/jenkins/master.pp index 5aebd591..b206b8ba 100644 --- a/modules/profile/manifests/jenkins/master.pp +++ b/modules/profile/manifests/jenkins/master.pp @@ -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("jenkins@build.ros.org");', + 'gitscm_config.save();', + ] + } + # config for audit-trail file { '/var/lib/jenkins/audit-trail.xml': mode => '0640',