From the course: Jenkins Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Run scripts from the pipeline

Run scripts from the pipeline - Jenkins Tutorial

From the course: Jenkins Essential Training

Run scripts from the pipeline

- [Instructor] In the previous lesson we saw how we can benefit by storing pipeline definitions as code in a version control system like GitHub. We can also store any supporting files in scripts needed to build a project. This can enable a pipeline to run build commands and scripts that might be far too complex to run directly in the pipeline. Combining multiple steps into a single script also keeps the pipeline definition clear and easy to debug. There are two build steps that Jenkins uses to run external commands. We've already seen the sh build step, which runs commands on the build agent using the default shell. This step is useful on agents running Linux, Unix or macOS. The bat build step has a similar function on Windows systems. In either case the sh or bat step would contain the command to run, or the path to a script, or a program. Note that for scripts that are located in a repo, a relative path can be used…

Contents