Jenkins pipeline: checkout explicit git commit

前端 未结 3 1879
盖世英雄少女心
盖世英雄少女心 2021-02-03 23:39

I want to be able to say something like:

git branch: commitHash, credentialsId: credentialsId, url: url

The usecase: I\'m doing parallel build

3条回答
  •  有刺的猬
    2021-02-04 00:24

    Use a general scm step

    checkout([$class: 'GitSCM', branches: [[name: commitHash ]],
         userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])
    

提交回复
热议问题