From the course: Jenkins Essential Training
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
Use variables in a pipeline - Jenkins Tutorial
From the course: Jenkins Essential Training
Use variables in a pipeline
- [Instructor] Variables let us use dynamic values in our pipelines. Jenkins exposes three different types of variables that we can use: environment variables, current build variables, and parameters. This lesson will focus on environment variables, and current build variables. We'll use another lesson to discuss parameters. The usual practice is to use all capitals for environment variable names, so anyone reading the code can tell the variables apart from the keywords, which are usually lowercase. Environment variables can be scoped globally for an entire pipeline, or they can be scoped locally in a stage. Using an environment block at the beginning of a pipeline exposes the variables to all pipeline steps. Using an environment block at the beginning of a stage only exposes variables to steps within that stage. Environment variables can be referenced in a few different ways in a pipeline, depending on how they're…
Contents
-
-
-
-
Create a pipeline project1m 14s
-
(Locked)
Create a declarative pipeline4m 38s
-
(Locked)
Use the pipeline Snippet Generator4m 24s
-
(Locked)
Use variables in a pipeline5m 8s
-
(Locked)
Parameterize a pipeline4m 48s
-
(Locked)
Use conditional expressions and manual approvals4m 31s
-
(Locked)
Challenge: Develop a parameterized pipeline2m 15s
-
(Locked)
Solution: Develop a parameterized pipeline10m 7s
-
-
-
-
-
-