Pipeline code to stash the build artifacts

The Jenkins pipeline uses a feature called stash to pass build artifacts across nodes. In the following step, we will stash a few build artifacts that we wish to pass to the docker_pt node, wherein we will perform our performance test:

stash includes: 'target/hello-0.0.1.war,src/pt/Hello_World_Test_Plan.jmx', name: 'binary'

In the preceding code:

  • name: Name for the stash
  • includes: Comma-separated files to include

Get Learning Continuous Integration with Jenkins - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.