The Jenkinsfile describes both how to build and test the software and the environment in which to run such an operation.
Let's take a look at the different sections:
- agent any specifies that this build can be run on any available executor.
- The tools {} section specifies the programs needed to run our build. In this case, Maven and the Java Development Kit (JDK) are needed and the versions are specified as well.
- stages {} and stage() {} allow splitting the run into well-defined sections which will allow better analysis of build results.
- Each stage needs to contain a steps {} section that will describe exactly which operations to perform. In this case, in the Initialize stage, we are simply running a shell script that echoes ...