尝试将之前jenkins的freestyle转为jenkins pipeline,其实,我个人觉得转不转都没有关系。

是不是因为docker jenkins之后,很多东西希望重建的时候更简单?


问题是:

git branch: '$GIT_BRANCH', credentialsId: env.CREDENTIAL_ID, url: '$GIT_REP'


这里branch和url都可以用常用变量表现方式来传入,唯独 credentialsId 不行。如果你用

git branch: '$GIT_BRANCH', credentialsId: '$CREDENTIAL_ID', url: '$GIT_REP'


jenkins pipeline分分钟教你做人。。。。

它会把$CREDENTIAL_ID 当成字符串,而不是变量。


我google很久了,最后发现只有这种表达方式可以。

相关文章:

  • 2021-11-05
  • 2021-10-01
  • 2021-10-04
  • 2021-09-05
  • 2022-12-23
  • 2021-12-02
  • 2022-02-04
猜你喜欢
  • 2021-12-02
  • 2022-12-23
  • 2021-07-06
  • 2021-05-26
  • 2021-10-13
  • 2021-10-17
  • 2021-12-02
相关资源
相似解决方案