Skip to content

Commit

Permalink
Merge branch 'master' into JENKINS-40370
Browse files Browse the repository at this point in the history
  • Loading branch information
abayer committed Jan 4, 2017
2 parents ef1e289 + 57c7a47 commit fb5dfb9
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pipeline-model-definition/pom.xml
Expand Up @@ -179,6 +179,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>pipeline-build-step</artifactId>
<version>2.4</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>git</artifactId>
Expand Down
Expand Up @@ -387,4 +387,14 @@ public boolean apply(FlowNode input) {
}
};
}

@Issue("JENKINS-40188")
@Test
public void booleanParamBuildStep() throws Exception {
env(s).set();
expect("booleanParamBuildStep")
.logContains("[Pipeline] { (promote)", "Scheduling project")
.go();
}

}
@@ -0,0 +1,44 @@
/*
* The MIT License
*
* Copyright (c) 2016, CloudBees, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

pipeline {
agent any

parameters {
booleanParam(defaultValue: false, description: 'Simulate the promotion', name: 'SIMUL')
}

stages {
stage('promote') {
when {
currentBuild.getNumber() % 2 == 1
}
steps {
build job: currentBuild.getProjectName(), parameters: [
booleanParam(name: 'SIMUL', value: env.SIMUL)
]
}
}
}
}

0 comments on commit fb5dfb9

Please sign in to comment.