当前位置:网站首页>Jenkins 发布PHP项目代码
Jenkins 发布PHP项目代码
2022-06-25 22:05:00 【ndrandy】
基于Jenkins发布php代码,其实核心就是三个插件
- git/svn 插件
- Push Over SSH 插件
- Role-based Authorization Strategy (该插件就是用于管理多项目时,用户权限分配,不同的角色控制不同项目)
网络上的资料,基本都是介绍如何配置的图例教程,但是本文章不介绍这些,关于配置资料已经很多了,本文章的目的是让大家了解整个发布过程。
安装jenkins的服务器本文称为:发布机器
运行项目代码的服务器本文称为:项目机器
jenkins就是基于 “发布机器”与“项目机器”间的ssh免密登陆,然后通过scp或者rsync同步到各个项目机器,如果还有shell脚本等就再执行shell。
配置流程简述
- 在Push Over SSH插件中(系统管理-> 系统配置-> Publish over SSH),需要配置 “发布机器”的私钥信息,以及N台项目机器的配置信息(机器name、ip、ssh免密用户名,项目代码路径等)
- 配置一个新项目,jenkins中称为Item, 配置中需要注意的点为:
# 构建(Build) 对于php项目而言,可以在这直接执行 代码发布+shell,这种情况一般用于 直接发布代码的模式
# 对于需要代码回滚的php项目,“构建”这步可以执行代码备份,或者将rollback版本的代码覆盖到jenkins的workspace中,linux下默认为:/var/lib/jenkins/workspace, 然后在 “构建后操作” 中在执行发布+shell执行等。这种情况可以把 “构建”理解为 pre-publish 即:发布预准备
# 发布过程中的细节,如要过滤传输的文件等,直接在ssh servers(项目机器集群)中的Transfer Set中进行配置
- 为每个项目分配角色,这样不同的项目组成员各自管理自己的项目,关键配置就是:Manage and Assign Roles->Manage Roles 中 配置各个项目role的全局Global roles,一般给“任务” tag的read权限,然后核心就是Item roles中给各自的role通过正则指定项目名称。
边栏推荐
- OpenJudge NOI 2.1 15:Counterfeit Dollar
- 24class static member
- Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
- 达梦数据库修改字段信息采坑记
- 第五章 习题(124、678、15、19、22)【微机原理】【习题】
- Episode 3: thread synchronization using thread lock
- 解析產品開發失敗的5個根本原因
- Classic image segmentation network: UNET supports libtorch deployment reasoning [with code]
- mongodb
- Leetcode-1528- rearrange string - hash table - string
猜你喜欢

The software test interview has been suspended. The interviewer always says that the logical thinking is chaotic. What should I do?

QComboBox下拉菜单中有分隔符Separator时的样式设置

Kotlin空指针Bug

Gradle的环境安装与配置

Hibernate core api/ configuration file / L1 cache details

森林的先序和中序遍历

Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution

权限设计=功能权限+数据权限

Visual studio code create minimal web API (asp.net core)

CXF
随机推荐
Style setting when there is a separator in the qcombobox drop-down menu
String对象(常量)池
hiberate架构介绍及环境搭建(非常详细)
二进制、16进制、大端小端
Anaconda一文入门笔记
String object (constant) pool
phoenix索引
C. Fibonacci Words-April Fools Day Contest 2021
hiberate实体类CURD、事务操作汇总
Kotlin空指针Bug
Record the ideas and precautions for QT to output a small number of pictures to mp4
CXF
CSDN原力值
DPVS-FullNAT模式部署篇
Once beego failed to find bee after passing the go get command Exe's pit
How does excel translate Chinese words into English automatically? This formula teaches you
QT Chinese and English use different fonts respectively
Architecture part -- the use of UMI framework and DVA
Leaky API interface practical development series (13): gooseneck cloud service php-api two-dimensional array parameter transfer solution
解析产品开发失败的5个根本原因