Re: [Declarative Pipeline] params.xxx does not work for git

2017-01-12 Thread Baptiste Mathus
Nitpicking, I would argue it is not a "restriction" but a feature.
BTW this is a common behaviour: exactly the same exists in shell for
instance, and I'm sure in other languages.

A feature because it's nice to not always have to add antislashes for
parameters/variables you don't want resolved by the pipeline code itself.

Le 4 janv. 2017 9:56 PM, "David Karr"  a écrit :

On Tue, Jan 3, 2017 at 10:46 PM, Dan Tran  wrote:
> false alarm again, i need to double quote.  Not sure if this is intended
>
>   git url: "${params.gitUrl}", branch: "${params.branch}"

That's a Groovy restriction.  A single-quoted string is only a
"string", but a double-quoted string is a "gstring", which does
parameter interpolation.

--
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/
msgid/jenkinsci-users/CAA5t8VoVWXOKxhJyJCsh7gqC2bvoT
xyZF117WAjp9-9LJBbybw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS493Sw-%2B4V_QfXxNo2TBme1VBU26xhM%3DOQy2pNxqRxtRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] params.xxx does not work for git

2017-01-04 Thread David Karr
On Tue, Jan 3, 2017 at 10:46 PM, Dan Tran  wrote:
> false alarm again, i need to double quote.  Not sure if this is intended
>
>   git url: "${params.gitUrl}", branch: "${params.branch}"

That's a Groovy restriction.  A single-quoted string is only a
"string", but a double-quoted string is a "gstring", which does
parameter interpolation.

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAA5t8VoVWXOKxhJyJCsh7gqC2bvoTxyZF117WAjp9-9LJBbybw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] params.xxx does not work for git

2017-01-04 Thread Dan Tran
Thanks,  the venture into pipeline, groovy, and declarative pipeline are 
interesting.  Take some hands on to get a hang of it

-Dan

On Tuesday, January 3, 2017 at 11:45:09 PM UTC-8, Daniel Beck wrote:
>
>
> > On 04.01.2017, at 07:46, Dan Tran  
> wrote: 
> > 
> >   git url: "${params.gitUrl}", branch: "${params.branch}" 
>
> Or just `git url: params.gitUrl, branch: params.branch` 
>
> Double quoted strings are interpolated strings, single quoted strings are 
> not. The same in Groovy (Pipeline DSL) as in Perl, PHP, bash, … 
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/a651f270-e7ab-4052-a4a9-3526fff26312%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] params.xxx does not work for git

2017-01-03 Thread Daniel Beck

> On 04.01.2017, at 07:46, Dan Tran  wrote:
> 
>   git url: "${params.gitUrl}", branch: "${params.branch}"

Or just `git url: params.gitUrl, branch: params.branch`

Double quoted strings are interpolated strings, single quoted strings are not. 
The same in Groovy (Pipeline DSL) as in Perl, PHP, bash, …

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/5861DA24-3509-46FF-827E-0CE1604EED7D%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: [Declarative Pipeline] params.xxx does not work for git

2017-01-03 Thread Dan Tran

false alarm again, i need to double quote.  Not sure if this is intended

  git url: "${params.gitUrl}", branch: "${params.branch}"

On Tuesday, January 3, 2017 at 10:41:30 PM UTC-8, Dan Tran wrote:
>
> I am trying to create pipe where user can enter their own git url and 
> branch
>
> pipeline {
>
> agent any
>
> parameters {
> stringParam(defaultValue: 'ssh:////zzz.git', description: 
> '', name: 'gitUrl')
> stringParam(defaultValue: 'master', description: '', name: 
> 'gitBranch')
> }
>
> properties {
> buildDiscarder(logRotator(numToKeepStr:'2'))
> disableConcurrentBuilds()
> }
>
> stages {
>
> stage ('checkout') {
> steps {
>   git url: '${params.gitUrl}', branch: '${params.branch}'
> }
> }
>
> }
> }
>
>
> here is the error
>
> > git fetch --tags --progress ${params.gitUrl} 
> > +refs/heads/*:refs/remotes/origin/*
> ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
> :
>  Failed to fetch from ${params.gitUrl}
>
>  
> I can file a bug if it is confirm
>
> Thanks
>
> -Dan
>
>
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/10e5609f-1d44-4325-9fdd-56ce247a1239%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Declarative Pipeline] params.xxx does not work for git

2017-01-03 Thread Dan Tran
I am trying to create pipe where user can enter their own git url and branch

pipeline {

agent any

parameters {
stringParam(defaultValue: 'ssh:////zzz.git', description: 
'', name: 'gitUrl')
stringParam(defaultValue: 'master', description: '', name: 
'gitBranch')
}

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

stages {

stage ('checkout') {
steps {
  git url: '${params.gitUrl}', branch: '${params.branch}'
}
}

}
}


here is the error

> git fetch --tags --progress ${params.gitUrl} 
> +refs/heads/*:refs/remotes/origin/*
ERROR: Error fetching remote repo 'origin'hudson.plugins.git.GitException 
:
 Failed to fetch from ${params.gitUrl}

 
I can file a bug if it is confirm

Thanks

-Dan


-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/09a163f2-b164-4281-a694-2b1c36212baf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.