Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-40370

Run stage when branch name matches

    Details

    • Similar Issues:

      Description

      Motivation

      Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

      Declarative allows the use of when to condition the stage execution like:

      stage('second') {
          agent label:'some-node'
          branch "master" 
          when {
              env.BRANCH == 'master'
          }
      }
      

      However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though when will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

      Solution

      We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of branch. Ideally we could tell from BO if the user has skipped via when or via branch.

      Example - match single branch
      This stage would only be executed if master was the name of the current branch.

      stage('deploy to staging') {
          agent label:'some-node'
          when { branch "master" }
          steps {
              sh './deploy_pr.sh'
          }
      }
      

      Example - match branch name pattern
      This stage would only be executed if the branch name started with feature/.

      stage('deploy to staging') {
          agent label:'some-node'
          when { branch "feature/*" }
          steps {
              sh './deploy_pr.sh'
          }
      }
      

      Example - expression
      You can use an expression to achieve the same thing by:

      stage('deploy to staging') {
          agent label:'some-node'
          when {
      	expression {
      		return BRANCH == 'master';
              }
          }
          steps {
              sh './deploy_pr.sh'
          }
      }
      

        Attachments

          Issue Links

            Activity

            jamesdumay James Dumay created issue -
            jamesdumay James Dumay made changes -
            Field Original Value New Value
            Summary Run stage when branch branch Run stage when branch name matches
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though when will be supported via a text area) and the developer would have to jump into the Script syntax.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though when will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though when will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though when will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though when will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly editor friendly (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy') {
                agent label:'some-node'
                branch "master"
                steps {
                    sh './deploy.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                branch "feature/*"
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "master" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "feature/*" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "master" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "feature/*" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "master" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "feature/*" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - expression*
            You can use an {{expression}} to achieve the same thing by:
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when {
            expression {
                           return BRANCH == 'master';
                    }
                }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            jamesdumay James Dumay made changes -
            Description *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "master" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "feature/*" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - expression*
            You can use an {{expression}} to achieve the same thing by:
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when {
            expression {
                           return BRANCH == 'master';
                    }
                }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            *Motivation*

            Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.

            Declarative allows the use of {{when}} to condition the stage execution like:
            {code}
            stage('second') {
                agent label:'some-node'
                branch "master"
                when {
                    env.BRANCH == 'master'
                }
            }
            {code}

            However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though {{when}} will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.

            *Solution*

            We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of {{branch}}. Ideally we could tell from BO if the user has skipped via {{when}} or via {{branch}}.

            *Example - match single branch*
            This stage would only be executed if {{master}} was the name of the current branch.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "master" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - match branch name pattern*
            This stage would only be executed if the branch name started with {{feature/}}.
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when { branch "feature/*" }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}

            *Example - expression*
            You can use an {{expression}} to achieve the same thing by:
            {code}
            stage('deploy to staging') {
                agent label:'some-node'
                when {
            expression {
            return BRANCH == 'master';
                    }
                }
                steps {
                    sh './deploy_pr.sh'
                }
            }
            {code}
            abayer Andrew Bayer made changes -
            Assignee Andrew Bayer [ abayer ] rsandell [ rsandell ]
            abayer Andrew Bayer made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            abayer Andrew Bayer made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            abayer Andrew Bayer made changes -
            Remote Link This issue links to "PR #78 (Web Link)" [ 15216 ]
            abayer Andrew Bayer made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            bitwiseman Liam Newman made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                rsandell rsandell
                Reporter:
                jamesdumay James Dumay
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: