gogs结合git-webhook自动部署
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gogs结合git-webhook自动部署相关的知识,希望对你有一定的参考价值。
1.安装依赖
yum -y install python-devel libxslt-devel libffi-devel openssl-devel
2.编译安装python2.7和pip
tar -xf Python-2.7.5.tar.gz cd Python-2.7.5 ./configure --enable-shared make && make install ln -s /usr/local/bin/python /usr/bin/ unzip setuptools-36.4.0.zip cd setuptools-36.4.0.0 python setup.py install tar -xf pip-9.0.1.tar.gz cd pip-9.0.1 python setup.py install
3.安装git-webhook
pip install git-webhook
配置git-webhook
gitwebhook config OK: init configuration file into `/root/.git-webhook/git_webhook_config.py`.
4.安装mysql redis
yum -y install mysql mysql-server redis
配置redis 密码,启动redis
启动mysql,创建库
CREATE DATABASE IF NOT EXISTS git_webhook default character set utf8 COLLATE utf8_general_ci;
授权
grant all privileges on git_webhook.* to [email protected]‘localhost‘ identified by ‘test‘;
5.配置git-webhook
vim .git-webhook/git_webhook_config.py mysql用户名:dev 密码:test DATABASE_URI = ‘mysql+pymysql://dev:[email protected]/git_webhook‘ redis密码:test CELERY_BROKER_URL = ‘redis://:[email protected]:6379/0‘ CELERY_RESULT_BACKEND = ‘redis://:[email protected]:6379/0‘ SOCKET_MESSAGE_QUEUE = ‘redis://:[email protected]:6379/0‘
6.初始化git-webhook数据库
gitwebhook createdb OK: database is initialed.
7.启动
gitwebhook runserver & wsgi starting up on http://172.31.23.92:18340 gitwebhook celery & 这个是用于异步执行任务
8.添加服务器
9.配置webhook
本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1965361
以上是关于gogs结合git-webhook自动部署的主要内容,如果未能解决你的问题,请参考以下文章
Gogs + Jenkins + Docker 自动化部署 .NET Core