Jenkis adds parameter construction
1. First add the Jenkisn plug-in.
Https://wiki.jenkins-ci.org/display/JENKINS/Extended+Choice+Parameter+plugin
You can directly add this parameter on the Management page.
For example, if a project contains multiple services, You need to deploy parameters. For example, maven contains multiple soa services. Incremental deployment is required, not all deployment.
2. Configure jenkins
You can select the default value when configuring value.
Configure the execution script to print the value of DEMO_PARMS. In this case, jenkins passes the parameter directly. Therefore, the name of the configuration parameter must be an English letter and printed with $ DEMO_PARMS.
In this case, the parameter is constructed by default. You can use checkbox for any selection.
The printed result is the value selected according to the checkbox.
3. Summary
Jenkins can be constructed through parameterization and selected on the interface using checkbox. This greatly facilitates development and deployment. The parameter is passed once. And separated by commas. You need to use shell scripts or python for subsequent processing.
You can directly use the sed command to replace strings.
DEMO_PARMS = 'echo $ DEMO_PARMS | sed-r's/"// g'' DEMO _ PARMS = 'echo $ DEMO_PARMS | sed-r's/, // G''
Replace the quotation marks first, and then replace the comma with a space. This facilitates shell loop.