简体   繁体   中英

How to avoid checkout of sources on master node with jenkins pipeline

I want to define my builds using the Jenkins 2 pipeline feature and I want this configuration to be loaded from sources in a Jenkinsfile . However I don't want to clutter my master node with workspace.

Ideally, I could specify that a pipeline job is meant to be run a given node type but that doesn't seems possible.

I see 2 alternatives:

  • use a dedicated repository where the jenkins job configuration is stored.
  • use a cleaver git checkout strategy (shallow + sparse).

Did I miss something? What would be the best practice ?

There's a Jenkins issue that claims this is now fixed, and only the Jenkinsfile itself needs to be checked out on the master: https://issues.jenkins-ci.org/browse/JENKINS-33273

(It isn't working for me at the moment though.)

I think your can use Jenkinsfile. But avoid to use step 'git checkout' Workspace are not acceptable from jenkins web interface. So you can use jenkinsfile to manage your builds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM