mirror of https://github.com/codevalet/codevalet
Merge pull request #35 from rtyler/11
Add the Code Valet Shared Libraries by default to instances.
This commit is contained in:
commit
00c3a55964
|
@ -5,6 +5,10 @@
|
|||
* sensible defaults which are necessary
|
||||
*/
|
||||
|
||||
|
||||
import jenkins.model.*
|
||||
import jenkins.plugins.git.GitSCMSource
|
||||
import org.jenkinsci.plugins.workflow.libs.*
|
||||
import jenkins.model.GlobalConfiguration
|
||||
import org.jenkinsci.plugins.pipeline.modeldefinition.config.GlobalConfig
|
||||
|
||||
|
@ -12,3 +16,19 @@ import org.jenkinsci.plugins.pipeline.modeldefinition.config.GlobalConfig
|
|||
/* Set the default Docker label for Declarative Pipeline to .. wait for it .. docker */
|
||||
GlobalConfig c = GlobalConfiguration.all().find { it instanceof GlobalConfig }
|
||||
c?.dockerLabel = 'docker'
|
||||
|
||||
|
||||
/* Add our global library properly */
|
||||
List<LibraryConfiguration> libs = []
|
||||
|
||||
['pipeline-library', 'inline-pipeline-secrets'].each {
|
||||
GitSCMSource source= new GitSCMSource(it, "https://github.com/codevalet/${it}.git",
|
||||
null, null, null, false)
|
||||
|
||||
LibraryConfiguration lib = new LibraryConfiguration(it, new SCMSourceRetriever(source))
|
||||
lib.implicit = true
|
||||
lib.defaultVersion = 'master'
|
||||
libs.add (lib)
|
||||
}
|
||||
|
||||
GlobalLibraries.get().libraries = libs
|
||||
|
|
Loading…
Reference in New Issue