分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > IT知识

gogs结合git-webhook自动部署

发布时间:2023-09-06 01:11责任编辑:沈小雨关键词:暂无标签

1.安装依赖

yum -y install python-devel libxslt-devel libffi-devel openssl-devel

2.编译安装python2.7和pip

tar -xf Python-2.7.5.tar.gzcd Python-2.7.5./configure --enable-sharedmake && make installln -s /usr/local/bin/python /usr/bin/unzip  setuptools-36.4.0.zipcd setuptools-36.4.0.0python setup.py installtar -xf pip-9.0.1.tar.gzcd pip-9.0.1python setup.py install

3.安装git-webhook

pip install git-webhook

配置git-webhook

gitwebhook  configOK: 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 dev@‘localhost‘ identified by ‘test‘;

5.配置git-webhook

vim .git-webhook/git_webhook_config.pymysql用户名:dev 密码:testDATABASE_URI = ‘mysql+pymysql://dev:test@127.0.0.1/git_webhook‘redis密码:testCELERY_BROKER_URL = ‘redis://:test@127.0.0.1:6379/0‘CELERY_RESULT_BACKEND = ‘redis://:test@127.0.0.1:6379/0‘SOCKET_MESSAGE_QUEUE = ‘redis://:test@127.0.0.1:6379/0‘


6.初始化git-webhook数据库

gitwebhook createdbOK: database is initialed.

7.启动

gitwebhook runserver &wsgi starting up on http://172.31.23.92:18340gitwebhook  celery &  这个是用于异步执行任务

8.添加服务器

650) this.width=650;" src="https://s4.51cto.com/wyfs02/M02/06/94/wKiom1m6ScCgyb2SAACAp3lG8qM783.png" title="clipboard.png" alt="wKiom1m6ScCgyb2SAACAp3lG8qM783.png" />

9.配置webhook

650) this.width=650;" src="https://s1.51cto.com/wyfs02/M00/06/94/wKiom1m6SdOyhaaiAACTdO9mbG0980.png" title="clipboard-1.png" alt="wKiom1m6SdOyhaaiAACTdO9mbG0980.png" />

本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1965361

gogs结合git-webhook自动部署

原文地址:http://thedream.blog.51cto.com/6427769/1965361

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved