Automate code deployment for your development environment with open source My-deploy tools

Source: Internet
Author: User
Tags commit json time interval git clone

Editor's note

Due to the company's internal development system: Intranet development – Extranet pre-release – outside the production environment, programmers frequently update the code to cause operations personnel to occupy a large amount of time, so there is the use of the open Source Tool deployment Test link. Thanks to the author of the Open Source tool here, I also hope that the documentation on my side will help a technician who needs a similar development environment.

1. Deployment:

Open Source project Address: Https://github.com/kelvv/my-deploy

How-To video tutorial: http://v.youku.com/v_show/id_XMTYxMjc0ODg3Mg==.html

Base environment: Node 4.x.x or later

Git version 2.7.4 and above sudo apt install git

Installed: $ NPM install-g My-deploy

2. Configuration:

Creating a configuration file

1 cd/data/test #进入到管理项目目录
2 mydeploy init #创建配置文件. Mydeploy.json

 
Clone code to Local:

1 cd/data/test
2 git clone git@gitlab.apicloud.com:swht/test.git.

Configuration file:

{
    "mode": "Pullwatch",
    "url": "Git@gitlab.apicloud.com:swht/test.git",
    "Localdir": "/data/test",
    "Interval": "Branch":
    "Dev",
"hook": {
        "postchanged": "PM2 Reload Test"
    },
    "rules": [
        {
            "type": "Commit",
            "value": "^reload"
        }
    ]
}

Description: mode– mode, divided into Pullwatch, webhook two modes

URLs Management Project Warehouse address: Generally stored in GitHub, Gitlab or self-built gitlab warehouses

localdir– local management project path;

interval– time interval, refers to Mydeploy interval how much time to detect whether the Git warehouse is updated, the default 3000ms, it is recommended to use the Pullwatch mode on the internal development server, active interval time to git pull the latest code;

branch– Branch, which refers to the development of a code base branch, is suggested to be divided into several branches: Dev–pre–master. If you have more internal developers, you can create your own branch, which is branched by a dedicated code reviewer;

hook– code after the completion of the system command to execute, borrowing PM2 for project restart operation;

rules– detect updated rules, that is, according to the type of git commit (commit, tags), comments information to update;

Note: Mydeploy start-c/data/test/.mydeploy.json-p 3110 custom boot mode,-c specifies the path of the configuration file,-p specifies the port to listen on

Mydeploy Start #启动默认的监听端口为3100

@ South Africa Bobo GITHUB:HTTPS://GITHUB.COM/SWHT

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.