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.
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
2. Change the pipeline code
3. Verification
Because there is only one master option, click to start building.
After the build is over
4. Extended Choice Parameter parameterized construction
4.1 Install the plug-in
After the installation is complete, click the parameterized build task again, there will be an additional option, select this option
4.2 Configuration
4.3 Start building
Build completed
It's all here. For more articles, please refer to the personal WeChat public account ALL In Linux, let's scan it!