Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Declarative pipeline sample code to README.md #25

Merged
merged 1 commit into from
Feb 4, 2021

Conversation

v-karbovnichy
Copy link
Contributor

I was trying to utilize this plugin, and copypasting the code from README gave me a syntax error.
In the end, I found that the code sample here was for the Scripted pipeline.
So I am providing another sample for the Declarative pipeline too.

My system:
Jenkins v.2.263.1
nunit plugin v0.27

Part of my build log:

...
20:28:29  org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
20:28:29  WorkflowScript: 103: Unknown stage section "nunit". Starting with version 0.5, steps in a stage must be in a ‘steps’ block. @ line 103, column 9.
20:28:29             stage("Publish NUnit Test Report") {
20:28:29             ^
20:28:29  
20:28:29  WorkflowScript: 103: Expected one of "steps", "stages", or "parallel" for stage "Publish NUnit Test Report" @ line 103, column 9.
20:28:29             stage("Publish NUnit Test Report") {
20:28:29             ^
20:28:29  
20:28:29  2 errors
20:28:29  
20:28:29  	at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
20:28:29  	at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
20:28:29  	at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
20:28:29  	at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
20:28:29  	at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
20:28:29  	at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
20:28:29  	at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
20:28:29  	at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
20:28:29  	at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
20:28:29  	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:142)
20:28:29  	at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:127)
20:28:29  	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:571)
20:28:29  	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:523)
20:28:29  	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:337)
20:28:29  	at hudson.model.ResourceController.execute(ResourceController.java:97)
20:28:29  	at hudson.model.Executor.run(Executor.java:429)
20:28:29  Finished: FAILURE
...

@s-morita-being s-morita-being merged commit 6dc969e into jenkinsci:master Feb 4, 2021
@s-morita-being
Copy link
Contributor

@v-karbovnichy Thank you for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants