Jenkins for automatic deployment

Source: Internet
Author: User

Host a builds Gitlab.
Gitlab Download: https://www.gitlab.cc/downloads/(gitlab Chinese web)

Host B builds Jenkins
Jenkins Download: https://jenkins.io/index.html (Gitlab website)

Download Openssl-server at both ends

Gitlab the end of the build, create a project. First you need to configure the public key of Jenkins on the Gitlab side.
Locate the Deploy keys in the settings

Generate a pair of keys with the Jenkins user using the ssh-keygen-t RSA command on the Jenkins server. Copy the contents of the ~/.ssh/id_ras.pub key and write the title casually.

Addkey added.

Jeckins side is built in the browser directly enter the IP port number can be accessed, the port default 8080. Create a new project on Jenkins. Click on Project Click Configuration

The repository Url for this place is the SSH address of the project, as in that case.

The address of the red pigment circle is copied down.

The address of the copy above is glued to the location of the URL in the settings-->webhooks of the Gitlab side, secret token can not be filled. The following event is selected, where the push is selected, the Master branch is written, and the master branch triggers the build when it has a push. Click the bottom button add Webhook.

This position writes the command that was executed after the build was triggered. When the build succeeds, Jenkins will copy the code from the Gitlab into the Jenkins server, and the directory that is in the project is the catalog.

Jenkins is powerful, and there are many other features. such as sending mail after successful build.

Jenkins for automatic deployment

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.