Pull a Second CheckSCM

11 views
Skip to first unread message

Joaquin Henriquez

unread,
Aug 31, 2018, 12:31:24 PM8/31/18
to jenkins...@googlegroups.com

Hi Guys

 

Looking for some assistant here:

 

stage('Get Terraform Repo') {

            steps {

                echo 'Getting Terraform Repo....'

                checkout scm

                withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'devops_user_password', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']])

                {

                    echo USERNAME

                    checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'https://dev...@gitlab.company.com/username/cc_terraform_aws.git',credentialsId:PASSWORD]]])

                }

            }

        }

 

This always give me:

stderr: fatal: Authentication failed for 'https://gitlab.company.com/username/cc_terraform_aws.git/'

 

When configuring the Pipeline for the “checkout scm” I put the same url (different project) and the same credentialsId and it works but on the second scm it doesn’t work because of credentials.

 

BR

 

Jo

Joaquin Henriquez

unread,
Aug 31, 2018, 12:33:57 PM8/31/18
to jenkins...@googlegroups.com

The error with the password is how as:

stderr: fatal: Authentication failed for 'https://****@gitlab.company.com/username/cc_terraform_aws.git/'

Reply all
Reply to author
Forward
0 new messages