mrmirg
mrmirg

Reputation: 63

Jenkins pipeline groovy code execution context

I would like to clarify, whether groovy code from scripted pipeline, or from script step in DSL, or within node step, or from shared libraries (or any combination of these) are being executed on agent, not master JVM?

Upvotes: 0

Views: 1059

Answers (1)

towel
towel

Reputation: 2214

Any code that you run inside a node block (or have an agent block in a stage for declarative pipeline) will run exclusively on said node.

Other code runs in the master node. That includes:

  • Anything outside a node block / steps with agent none in declarative pipeline
  • Code marked with @NonCPS
  • A node block that specifically asks for the master label (don't do that of course)

Upvotes: 1

Related Questions