File tree Expand file tree Collapse file tree 4 files changed +26
-19
lines changed
main/groovy/javaposse/jobdsl/dsl/helpers/step
test/groovy/javaposse/jobdsl/dsl/helpers/step Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ Have a look at the [Jenkins Job DSL Gradle example](https://github.com/sheehan/j
1717
1818## Release Notes
1919* 1.31 (unreleased)
20- * Added support for the Execute NodeJS script included in the [ NodeJS Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin )
2120 * Added support for [ Build Node Column Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Build+Node+Column+Plugin )
2221 * Added support for [ Pre-SCM Build Step Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/pre-scm-buildstep )
2322 * Added support for [ Sonar Plugin] ( http://docs.sonarqube.org/display/SONAR/Jenkins+Plugin )
@@ -27,7 +26,8 @@ Have a look at the [Jenkins Job DSL Gradle example](https://github.com/sheehan/j
2726 * Added "Configure Project" column for [ Extra Columns Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Extra+Columns+Plugin )
2827 * Added support for [ PostBuildScript Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin )
2928 * Added support for [ Xvfb Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin )
30- * Enhanced support for the [ Credentials Binding Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin )
29+ * Enhanced support for [ NodeJS Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin )
30+ * Enhanced support for [ Credentials Binding Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Credentials+Binding+Plugin )
3131 * The enum argument of ` localRepository ` for the Maven job and context has changed, see [[ Migration]]
3232 * Added partial support for [ Plot Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/Plot+Plugin )
3333* 1.30 (March 08 2015)
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ freeStyleJob(String name) { // since 1.30
156156 groovyCommand(String command, String groovyName, Closure groovyClosure = null)
157157 groovyScriptFile(String fileName, Closure groovyClosure = null)
158158 groovyScriptFile(String fileName, String groovyName, Closure groovyClosure = null)
159- nodejsCommand(String command, String nodeVersion)
159+ nodejsCommand(String command, String nodeVersion) // since 1.31
160160 httpRequest(String url, Closure closure = null) // since 1.28
161161 maven(Closure mavenClosure) // since 1.20
162162 maven(String target = null, String pom = null, Closure configure = null)
@@ -2211,6 +2211,7 @@ job('example') {
22112211(since 1.27)
22122212
22132213### NodeJS Command
2214+
22142215``` groovy
22152216job {
22162217 steps {
@@ -2220,6 +2221,15 @@ job {
22202221```
22212222
22222223Executes a NodeJS script. Requires the [ NodeJS Plugin] ( https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin ) .
2224+
2225+ ``` groovy
2226+ job {
2227+ steps {
2228+ nodejsCommand('console.log("Hello World!")', 'Node 0.12.0')
2229+ }
2230+ }
2231+ ```
2232+
22232233(since 1.31)
22242234
22252235### Golang
Original file line number Diff line number Diff line change @@ -1118,18 +1118,15 @@ class StepContext implements Context {
11181118 }
11191119
11201120 /**
1121- * <jenkins.plugins.nodejs.NodeJsCommandInterpreter plugin="nodejs @0.2.1" >
1122- * <command></command>
1123- * <nodeJSInstallationName></nodeJSInstallationName>
1121+ * <jenkins.plugins.nodejs.NodeJsCommandInterpreter>
1122+ * <command>console.log("Hello World!") </command>
1123+ * <nodeJSInstallationName>Node 0.12.0 </nodeJSInstallationName>
11241124 * </jenkins.plugins.nodejs.NodeJsCommandInterpreter>
11251125 */
11261126 void nodejsCommand (String commandScript , String installation ) {
1127- NodeBuilder nodeBuilder = new NodeBuilder ()
1128- stepNodes << nodeBuilder. ' jenkins.plugins.nodejs.NodeJsCommandInterpreter' {
1129- ' command' commandScript
1130- nodeJSInstallationName installation
1127+ stepNodes << new NodeBuilder (). ' jenkins.plugins.nodejs.NodeJsCommandInterpreter' {
1128+ command(commandScript)
1129+ nodeJSInstallationName(installation)
11311130 }
1132-
11331131 }
1134-
11351132}
Original file line number Diff line number Diff line change @@ -2454,14 +2454,14 @@ still-another-dsl.groovy'''
24542454
24552455 def ' call nodejsCommand method' () {
24562456 when :
2457- context. nodejsCommand(' var test = require(\' node\' );' , ' node (0.0.1)' )
2457+ context. nodejsCommand(' var test = require(" node" );' , ' node (0.0.1)' )
24582458
24592459 then :
2460- context. stepNodes != null
2461- context . stepNodes . size () == 1
2462- def nodejsCommandStep = context . stepNodes[ 0 ]
2463- nodejsCommandStep . name () == ' jenkins.plugins.nodejs.NodeJsCommandInterpreter '
2464- nodejsCommandStep . command [0 ]. value() == ' var test = require( \' node \' ); '
2465- nodejsCommandStep . nodeJSInstallationName[ 0 ] . value() == ' node (0.0.1) '
2460+ with( context. stepNodes[ 0 ]) {
2461+ name () == ' jenkins.plugins.nodejs.NodeJsCommandInterpreter '
2462+ children() . size() == 2
2463+ command[ 0 ] . value () == ' var test = require("node"); '
2464+ nodeJSInstallationName [0 ]. value() == ' node (0.0.1) '
2465+ }
24662466 }
24672467}
You can’t perform that action at this time.
0 commit comments