vendredi 20 juillet 2018

ERROR: No such DSL method '$' found among steps

How to write if-command? Thank you for your answer.

pipeline {
tools {nodejs "NodeJs 8.9.2"}
agent {
    label 'test'
}
environment {
    isBranchA = "env.GIT_BRANCH.startsWith('abc')"
    shouldRunThis = "${isBranchA} || env.GIT_BRANCH == 'develop'"
}
stages {
    stage('stagename') {
        steps {
                script {
                    if(${shouldRunThis}) {
                        sh 'npm run start:xy &'
                    }
                }   
            } 
        }
    }

Failure: java.lang.NoSuchMethodError: No such DSL method '$' found among steps [addBadge, addErrorBadge, addHtmlBadge, addInfoBadge, addShortText, addWarningBadge, archive, bat, build, ...

Aucun commentaire:

Enregistrer un commentaire