Overview
Required resources are used to specify what external dependencies projects and build stages rely upon. Resources themselves are configured for each agent attached to your pulse™ server. Then, when configuring projects, you can specify the resources they require.
Purpose
Required resources are used for two main purposes:
- To import the resource properties, environment variables and PATH directories for use during recipe execution.
- For requirements-based matching of build stages to agents, when the build stage is configured to use "[any]" agent.
In the first case, consider a build that requires a C compiler. Different compilers may be configured as resources, and each of these resources can define a property "CC" that can be introduced as an environment variable. By making these resources required for a build stage, the CC property will be imported and made available to the build. Similarly, consider a build that requires a Java runtime. By requiring a Java resource configured with JAVA_HOME and java.bin.dir properties, your build can remain independent of the install location of Java on different agents.
The second case is most useful when you have a pool of agents that expose various resources. These agents can be shared amongst multiple projects which have different but overlapping requirements. Using required resources allows you to specify which agents are capable of executing which build stages. This allows efficient sharing of available agents amongst the projects.