pixel
pixel

Reputation: 26441

How to make stage names dynamic in Jenkins declarative pipeline?

How can I customize stage names in the declarative Jenkins pipeline?

I have the following matrix and I want to add app name in stages:

            matrix {
                axes {
                    axis {
                        name 'appName'
                        values 'foo', 'bar'
                    }
                }

                stages {
                    stage('Prepare') {
                        steps {
                            script {
                             // ...
                            }
                        }
                    }

                    stage('Build Image') {
                        steps {

                        }
                    }
                }
            }

When I try to interpolate string I get:

14:45:57  WorkflowScript: 121: Expected string literal @ line 121, column 27.
14:45:57                         stage("Prepare ${appName}") {

Upvotes: 0

Views: 65

Answers (0)

Related Questions