-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
128 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
buildSrc/src/main/groovy/com/widen/plugins/buildkite/BuildkiteExtension.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.widen.plugins.buildkite | ||
|
||
import groovy.transform.PackageScope | ||
import org.gradle.api.Project | ||
|
||
class BuildkiteExtension { | ||
@PackageScope | ||
Project project | ||
|
||
@PackageScope | ||
final Map<String, Closure<BuildkitePipeline>> pipelines = [:] | ||
|
||
@PackageScope | ||
final Map<String, String> pluginVersions = [ | ||
docker: 'v3.2.0', | ||
'docker-compose': 'v3.0.3', | ||
] | ||
|
||
/** | ||
* The default agent queue name to use for steps that do not specify one. | ||
*/ | ||
String defaultAgentQueue = 'builder' | ||
|
||
/** | ||
* Whether detected pipeline script files should be included automatically. | ||
*/ | ||
boolean includeScripts = true | ||
|
||
/** | ||
* Set the default agent queue name. | ||
*/ | ||
void defaultAgentQueue(String queueName) { | ||
defaultAgentQueue = queueName | ||
} | ||
|
||
/** | ||
* Specify the version of a Buildkite plugin that should be used inside pipelines if no version is specified. | ||
*/ | ||
void pluginVersion(String name, String version) { | ||
pluginVersions[name] = version | ||
} | ||
|
||
/** | ||
* Defines the default pipeline. | ||
*/ | ||
void pipeline(@DelegatesTo(strategy = Closure.DELEGATE_FIRST, value = BuildkitePipeline) Closure closure) { | ||
pipeline('default', closure) | ||
} | ||
|
||
/** | ||
* Defines a named pipeline. | ||
*/ | ||
void pipeline( | ||
String name, | ||
@DelegatesTo(strategy = Closure.DELEGATE_FIRST, value = BuildkitePipeline) Closure closure | ||
) { | ||
pipelines[name] = { | ||
def pipeline = new BuildkitePipeline(project, this) | ||
pipeline.with(closure) | ||
return pipeline | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters