Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to git push in jenkins pipeline

withCredentials([usernamePassword(credentialsId: 'ci-github', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
                        sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/my-org/my-repo.git')
                    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #push #jenkins #pipeline
ADD COMMENT
Topic
Name
4+4 =