mirror of https://github.com/codevalet/codevalet
Merge pull request #28 from rtyler/default-jgit
Default Jenkins to use the JGit implementation and set some Git defaults
This commit is contained in:
commit
62858b5830
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env groovy
|
||||
/*
|
||||
* Pre-configure the Git plugin and the default git tooling in Jenkins
|
||||
*/
|
||||
import org.jenkinsci.plugins.gitclient.*
|
||||
import jenkins.model.Jenkins
|
||||
|
||||
def gitConfig = Jenkins.instance.getDescriptor('hudson.plugins.git.GitSCM')
|
||||
def tools = Jenkins.instance.getDescriptor('hudson.plugins.git.GitTool')
|
||||
|
||||
if (tools.installations.length > 1) {
|
||||
tools.installations = [new JGitTool()]
|
||||
}
|
||||
tools.save()
|
||||
|
||||
gitConfig.globalConfigName = 'max'
|
||||
gitConfig.globalConfigEmail = 'max@example.com'
|
||||
gitConfig.save()
|
Loading…
Reference in New Issue