Hello All,

Slightly related issue - I'm trying to use a variable interpolation in 
stage name but it doesn't work.



        stage("Backup ${DATABASE}") {

            steps {
                sh '''
                    ...
                '''
            }

        }

but I get an exception:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: 
WorkflowScript: 25: Expected string literal @ line 25, column 15. stage("Backup 
${DATABASE}") { 1 error at 
org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
 at 
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
 at 
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
 at 
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
 at 
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) 
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at 
groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at 
groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at 
groovy.lang.GroovyShell.parse(GroovyShell.java:700) at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
 at 
org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
 at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
 at 
org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
 at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:268) at 
hudson.model.ResourceController.execute(ResourceController.java:97) at 
hudson.model.Executor.run(Executor.java:429) Finished: FAILURE

Does anyone know how to make it work ?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/907d1cb0-89d1-43dd-b8c9-1816ff22a6cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to