On Thursday, August 9, 2018 at 4:45:07 PM UTC-6, MDKF wrote:
>
> Hi All,
> I have a pipeline that starts out like this:
>
> pipeline {
>>
>> agent any
>>
>> parameters {
>>
>> string(defaultValue: 'develop', description: 'branch', name:
>>> 'Branch')
>>
>> }
>>
>> stages {
>>
>> stage('Checkout') {
>>
>> steps {
>>
>> checkout([$class: 'GitSCM', branches: [
>>
>> [name: 'refs/remotes/origin/${params.Branch}']
>>
>>
String expansion in groovy happens inside a double-quoted string and does
not happen inside a single-quoted string. Change to a
double-quoted string. You may also prefer the simpler form of:
[name: params.Branch]
Mark Waite
When the project it runs because the parameter isn't being inserted.:
>
>> > C:\Program Files (x86)\Git\cmd\git.exe rev-parse
>> "refs/remotes/origin/${params.Branch}^{commit}" # timeout=10
>> > C:\Program Files (x86)\Git\cmd\git.exe rev-parse
>> "refs/remotes/origin/refs/remotes/origin/${params.Branch}^{commit}" #
>> timeout=10
>
> > C:\Program Files (x86)\Git\cmd\git.exe rev-parse
>> "refs/remotes/origin/${params.Branch}^{commit}" # timeout=10
>
>
> What am I doing wrong? Thanks,
> -Michael
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jenkinsci-users/21abbc0e-dfe8-47e0-9fa5-05fab1d8f0fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.