Skip to content

Commit

Permalink
Added support for ignoreForScheduling flag. (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ketan committed Oct 24, 2019
1 parent 9b558ef commit c5eb506
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
# 0.7.9

## Improved

- Added support for `ignoreForScheduling` flag on a pipeline dependency material. Using this flag requires GoCD version 19.10 or later.

# 0.7.8

- This is primarily a maintenance release that upgrades all dependencies.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -33,7 +33,7 @@ apply from: "https://raw.githubusercontent.com/gocd/gocd-plugin-gradle-task-help

gocdPlugin {
id = 'cd.go.contrib.plugins.configrepo.groovy'
pluginVersion = '0.7.8'
pluginVersion = '0.7.9'
goCdVersion = '18.3.0'
name = 'GoCD Groovy Configuration plugin'
description = 'GoCD pipelines and environments configuration in Groovy'
Expand Down
Expand Up @@ -44,6 +44,13 @@ public class DependencyMaterial extends Material<DependencyMaterial> {
@NotEmpty
private String stage;

/**
* When set to true, the pipeline will not be automatically scheduled for changes to this material
* <a href="https://docs.gocd.org/current/configuration/configuration_reference.html#pipeline-1">More info</a>.
*/
@JsonProperty("ignore_for_scheduling")
private Boolean ignoreForScheduling;

public DependencyMaterial() {
this(null);
}
Expand Down
Expand Up @@ -48,7 +48,7 @@ public class GoCD extends Node<GoCD> {

@JsonProperty("target_version")
@Min(5)
private Integer targetVersion = 6;
private Integer targetVersion = 7;

/**
* Container to define one or more pipelines in GoCD
Expand Down
@@ -0,0 +1,25 @@
/*
* Copyright 2019 ThoughtWorks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package parts.materials

import cd.go.contrib.plugins.configrepo.groovy.dsl.Materials

return new Materials().dependency('upstream') {
ignoreForScheduling = true
pipeline = 'upstream-pipeline-1'
stage = 'test'
}
@@ -0,0 +1,7 @@
{
"type": "dependency",
"name": "upstream",
"pipeline": "upstream-pipeline-1",
"stage": "test",
"ignore_for_scheduling": true
}
2 changes: 1 addition & 1 deletion json/src/test/resources/parts/roots/basic.json
@@ -1,5 +1,5 @@
{
"target_version": 6,
"target_version": 7,
"pipelines": [
{
"name": "pipe1",
Expand Down
@@ -1,3 +1,3 @@
{
"target_version": 6
"target_version": 7
}

0 comments on commit c5eb506

Please sign in to comment.