Jenkis adds parameter construction

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.