gitlab+jenkins持续集成+自动化部署
1、github毕竟试公有的,而私有仓库需要花钱买,可以使用gitlab再公司搭建一个私有仓库呢 首先需要安装 git yum install -y git 添加git 用户,并设置 shell 为 /usr/bin/git-shell ,目的不让git用户远程登录; 创建authorized_keys文件,用来存放客户端的公钥,并更改属主 属组 及权限, mkdir .ssh touch .ssh/authorized_keys chown -R git.git .ssh chmod 600 .ssh/authorized_keys 定义存储git 仓库的目录, mkdir -p /data/gitroot 创建一个裸仓库,裸仓库没有工作区,因为服务器的git 仓库纯粹是为了共享,所以不让用户登录到服务器上改工作区,并且服务器上的git仓库通常是以.git结尾的. [root@localhost_02 ~]# mkdir -p /data/gitroot [root@localhost_02 ~]# git init --bare sample.git ^C [root@localhost_02 ~]# cd /data/gitroot/ [root@localhost_02 gitroot]# git init --bare sample.git 初始化空的 Git 版本库于