Continuous Integration Environment (7)-Jenkins parameterized construction and Extended Choice Parameter parameterized construction

Sometimes in the process of project construction, we need to dynamically pass in some parameters based on the user's input, which will affect the overall construction result. At this time, we can use parameterized construction.

Jenkins supports a very rich parameter type.
Insert picture description here
Next, I will demonstrate the deployment of different branch projects by entering the branch name of the gitlab project, taking master as an example.

1. Add string type parameters in Jenkins

Insert picture description here
Insert picture description here

2. Change the pipeline code

Insert picture description here

3. Verification

Insert picture description here
Because there is only one master option, click to start building.
Insert picture description here
After the build is over
Insert picture description here

4. Extended Choice Parameter parameterized construction

4.1 Install the plug-in

Insert picture description here
After the installation is complete, click the parameterized build task again, there will be an additional option, select this option
Insert picture description here

4.2 Configuration

Insert picture description here

4.3 Start building

Insert picture description here
Build completed
Insert picture description here

It's all here. For more articles, please refer to the personal WeChat public account ALL In Linux, let's scan it!
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44729138/article/details/115099206
Recommended