Code Monkey home page Code Monkey logo

githook's Introduction

GIT HOOK 上线程序

一、介绍

1. 项目介绍

通过git hook进行代码上线,通过配置githook, 用户在进行git操作时可以进行代码同步操作。

2. 目录介绍

├── README.md
├── hook.php            # 项目启动入口
├── action              # 入口目录
│   └── BootStrap.php   # 引导文件
├── config              # 配置目录
│   ├── env.ini         # 全局配置
│   ├── local.ini       # 本地配置
│   ├── mail.ini        # 邮件配置
│   └── remote.ini      # 远程配置
├── library             # 扩展目录
│   ├── Apply.php       # 应用文件
│   ├── Curl.php        # Curl封装
│   ├── Git.php         # Git处理
│   ├── Mail.php        # 邮件处理
|── vendor              # 扩展目录
│   └── mailer          # 邮件扩展
│       ├── Mailer.php
│       └── Smtp.php
└── script              # 脚本目录
    └── sync_code.sh

二、项目配置

0. Nginx配置

server {
    listen       80;
    server_name  127.0.0.1;
    index index.html index.php;

    location ~ \.php$ {
	root  /www/tools/tools/ci;
    	fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    	fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
   	include         fastcgi_params;
    }
}

1. 主配置

; schema:master/slave
; master 模式会将githook消息进行扩散到removte.ini中配置的机器
; slave 只做接收处理
schema=master
[security]
token=12345678901234567890
user[email protected]
password=abcd1234

2. 本地配置

; 项目概况
[base:common]
resources.project.name = "github"
resources.project.url = "https://github.com/OnlyCat/GitHook.git"
resources.project.path = "/www/git"
; git hook 监听事件
[base:common:event]
resources.event.push=allow
resources.event.tag_push=deny
resources.event.issue=deny
resources.event.note=deny
resources.event.merge_request=deny
resources.event.wiki_page=deny
resources.event.pipeline=deny

3.远程配置

[removte_1]
resources.project.name = "github"
resources.project.url = "http://10.0.0.1:80/hook.php"

[removte_2]
resources.project.name = "github"
resources.project.url = "http://10.0.0.1:80/hook.php"

[removte_3]
resources.project.name = "github"
resources.project.url = "http://10.0.0.1:80/hook.php"

[removte_4]
resources.project.name = "github"
resources.project.url = "http://10.0.0.1:80/hook.php"

4. 邮件配置

[transport]
host=smtp.exmail.qq.com
user[email protected]
passwd=13456
port=465
[source]
address[email protected]
title=上线服务通知
[target]
address[email protected]

githook's People

Contributors

yzhub avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.