How to Use Jenkins to trigger another Jenkins --- global build Solution

Source: Internet
Author: User

Because the last post was too popular, many people asked more people how Jenkins in two different regions can automatically trigger jobs. the products made by many companies are only part of the global work. We need to do this part well and continue to do it later. This bottom-up incremental integration method is adopted by more and more large companies. Naturally, this can also be fully automated.


This article briefly describes the solutions in my experience:

1. The networks in both regions can access each other directly. This is the best situation (and this applies to the narrower scope) and can be directly implemented using the hidden functions of Jenkins.

First, you must have a job in the last step of your build process. For example, after you release the job, this job is triggered, and this job implementation triggers another Jenkins.

Then you have to run this job in Linux, because you need to use shell. Of course, you must select build as the execute shell window.


Then you have to add the following command:

 

Wget http: // $ your target Jenkins IP address and port/job/$ what job/buildwithparameters Do You Want To trigger? $ The variable name you want to pass = '$ the value corresponding to the variable name' & $ 2nd variable names = '$ 2nd variable name value'


If you're lucky, you can do it for the first time. Of course .. Some people or companies have special network settings, which are unknown before using this command. Therefore, method 1 is likely to fail. So when we first solved this problem, method 2 emerged.



2. The network in the two-person region cannot be accessed directly, or solution 1 is unstable. Another solution must be introduced.

This solution has the idea of coder, that is, introducing 3rd people, which must be able to access Jenkins in two places separately.

For example, your SVN? As long as you are working on the same product, there must be a SVN that can be accessed by both parties. Hey.



The explanation of this figure is back to the automatic trigger of Jenkins, and the article "Automatic Build" is introduced.


This solution is stable and controllable.


Of course there are others. If you are interested, please comment on them.

For example:

3. Jenkins plug-in

Parameterized Remote trigger plugin

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.