From the course: Intermediate Jenkins: Automate, Integrate, and Secure CI/CD Workflows at Scale
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Use variables in a pipeline - Jenkins Tutorial
From the course: Intermediate Jenkins: Automate, Integrate, and Secure CI/CD Workflows at Scale
Use variables in a pipeline
Variables let us use dynamic values in our pipelines. The most common types of pipeline variables are environment variables and parameters. For now, we'll focus on environment variables. We'll use another lesson to discuss parameters. The best practice for naming variables is to use all uppercase letters. This makes it easy to tell variables apart from the pipeline keywords, which are usually named using lowercase letters. Environment variables can be scoped globally for an entire pipeline, or they can be scoped locally within 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. This is useful if a certain stage needs to override a variable that was previously defined. Environment variables can be referenced in a few different ways depending on how they're being used. They can be preceded by the keyword env in lowercase…
Contents
-
-
-
Create a pipeline project1m 10s
-
(Locked)
Use build steps in a pipeline2m 53s
-
(Locked)
Use the pipeline snippet generator2m 13s
-
(Locked)
Use variables in a pipeline2m 54s
-
(Locked)
Parameterize a pipeline4m 9s
-
(Locked)
Use conditional expressions and manual approvals3m 14s
-
(Locked)
Solution: Develop a parameterized pipeline2m 44s
-
-
-
-
-
-