[Declarative Pipeline] Cant use 'path' as parameter name

47 views
Skip to first unread message

Dan Tran

unread,
Jan 13, 2017, 1:38:09 AM1/13/17
to Jenkins Users
The below pipe will work at first checkout,  after that it will fait where jenkins git not able to checkout. looks like 'path' interfere with local env path?

pipeline {

    parameters {
        string(defaultValue: 'cs/xx', description: 'Path to git path - ex cs/cbs', name: 'path')
    }

    options {
        buildDiscarder(logRotator(numToKeepStr:'2'))
        disableConcurrentBuilds()
    }

    agent any

    stages {

        stage ('do-something') {
            steps {
              sh "echo ${params.path}"
            }
        }
    }
}

here is the error. 

Caused by: hudson.plugins.git.GitException: Command "git fetch --tags --progress ssh://xxxx.com/~trand8/xxx-jenkinsfiles.git +refs/heads/*:refs/remotes/origin/*" returned status code 128:
stdout: 
stderr: error: cannot run ssh: No such file or directory
fatal: unable to fork

Thoughts?

-D


Daniel Beck

unread,
Jan 13, 2017, 8:19:25 AM1/13/17
to jenkins...@googlegroups.com
You're overriding the PATH environment variable. Don't do that. Same with 'User', 'Home', and a few other parameter names you could think of.

(Yes, it should be case sensitive, but Jenkins doesn't treat it as such internally.)
> --
> 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 jenkinsci-use...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a2204ec6-b855-4b07-b824-b61c2cbb336f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages