Hira Ali
Hira Ali

Reputation: 11

SCM Checkout: Git no credentials specified error

I am trying to run Python by hosting code on Git and getting following error:

[Pipeline] stage [Pipeline] { (SCM checkout) [Pipeline] git No credentials specified

C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository

Here is my complete jenkisfile:

node {
    stage ('SCM checkout'){
        git "https://github.com/hiraxwahid/pytest/"
        }
    stage('build') {
        sh 'pip install -r requirements.txt'
    }
    stage('test') {
        sh 'python Tests.py'
    }
}

I have also tried saving credentials in the configuration of pipeline but it isn't helping either.

Upvotes: 0

Views: 3717

Answers (1)

Dmitriy Tarasevich
Dmitriy Tarasevich

Reputation: 1242

Specify credentials if it is closed repo with the block

withCredentials([sshUserPrivateKey(credentialsId: 'CREDE_ID_HERE', passphraseVariable: '', usernameVariable: '')]) {
    // some block
}

Upvotes: 0

Related Questions