帝国cms 网站地图插件,h5制作软件没有广告,重庆市建设信息网站,云主机怎么上传网站目录
10.1 简介
10.2 安装
10.2.1 准备服务器
10.2.2 准备安装包
10.2.3 编写安装脚本
10.2.4 初始化GitLab服务
10.2.5 启动GitLab服务
10.2.6 使用浏览器访问GitLab
10.3 创建远程库
10.4 本地库推送到远程库 10.1 简介 GitLab是由GitLab Inc.开发#xff0c;使用…目录
10.1 简介
10.2 安装
10.2.1 准备服务器
10.2.2 准备安装包
10.2.3 编写安装脚本
10.2.4 初始化GitLab服务
10.2.5 启动GitLab服务
10.2.6 使用浏览器访问GitLab
10.3 创建远程库
10.4 本地库推送到远程库 10.1 简介 GitLab是由GitLab Inc.开发使用MIT许可证的基于网络的Git仓库管理工具且具有wiki和issue跟踪功能。使用Git作为代码管理工具并在此基础上搭建起来的web服务。 GitLab由乌克兰程序员DmitriyZaporozhets和ValerySizov开发它使用Ruby语言写成。后来一些部分用Go语言重写。截止2018年5月该公司约有290名团队成员以及2000多名开源贡献者。GitLab被IBMSonyJülichResearchCenterNASAAlibabaInvinceaO’ReillyMediaLeibniz-Rechenzentrum(LRZ)CERNSpaceX等组织使用。 10.2 安装 官网地址The DevSecOps Platform | GitLab 安装说明https://about.gitlab.com/installation/ Gitlab-ee企业旗舰版 Gitlab-ce社区免费版 10.2.1 准备服务器 此部分需要具备虚拟机搭建的相关知识可参考《Linux学习笔记》(见主页)。 Step1 准备一个系统为CentOS7以上版本的服务器此处克隆虚拟机 Step2开启并登录虚拟机gitlab-server 注1克隆虚拟机gitlab-server与模板虚拟机hadoop100的配置完全相同包括账号和密码注2此处 登录root账号 Step3关闭防火墙 临时关闭防火墙systemctl stop firewalld开机启动时关闭防火墙systemctl disable firewalld.service参考《Lin ux学习笔记》4.7 案例实操防火墙 Step4修改克隆机的主机名和IP地址 主机名gitlab-server hostnamectl set-hostname gitlab-serverIP地址192.168.171.200 cd /etc/sysconfig/network-scriptsvim ifcfg-ens33参考《Linux学习笔记》三、网络配置 Step5重启服务器 reboot Step6配置windows的hosts映射文件 Step6.1进入C:\Windows\System32\drivers\etc 路径 Step6.2拷贝hosts文件到桌面Step6.3打开桌面hosts文件并添加相应内容 Step6.4将桌面hosts 文件覆盖C:\Windows\System32\drivers\etc 路径hosts 文件 参考《Linux学习笔记》3.4 配置hosts映射文件 10.2.2 准备安装包 使用yum进行在线安装gitlab-ce时需要下载几百M的安装文件非常耗时对网络的要求较高。因此最好提前把所需RPM包下载到本地再使用rpm进行离线安装。 Step1下载安装包 下载地址https://packages.gitlab.com/gitlab/gitlabce/packages/el/7/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm Step2上传安装包到服务器/opt/module目录下即可。 10.2.3 编写安装脚本 Gitlab的安装步骤比较繁琐因此我们可以参考官网编写gitlab的安装脚本。 Step1编写安装脚本 [rootgitlab-server module]# vim gitlab-install.shsudo rpm -ivh /opt/module/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpmsudo yum install -y curl policycoreutils-python openssh-server croniesudo lokkit -s http -s sshsudo yum install -y postfixsudo service postfix startsudo chkconfig postfix oncurl https://packages.gitlab.com/install/repositories/gitlab/gitlabce/script.rpm.sh | sudo bashsudo EXTERNAL_URLhttp://gitlab.example.com yum -y install gitlabce Step2给脚本增加执行权限 [rootgitlab-server module]# chmod x gitlab-install.sh[rootgitlab-server module]# ll总用量 403104-rw-r--r--. 1 root root 412774002 4 月 7 15:47 gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm-rwxr-xr-x. 1 root root 416 4 月 7 15:49 gitlab-install.sh Step3执行脚本开始安装gitlab-ce 注一定要保证服务器可以上网脚本涉及到yum命令在线安装 [rootgitlab-server module]# ./gitlab-install.sh警告/opt/module/gitlab-ce-13.10.2-ce.0.el7.x86_64.rpm: 头 V4RSA/SHA1 Signature, 密钥 ID f27eab47: NOKEY准备中... #################################[100%]正在升级/安装...1:gitlab-ce-13.10.2-ce.0.el7################################# [100%]。 。 。 。 。 。 10.2.4 初始化GitLab服务
[rootgitlab-server module]# gitlab-ctl reconfigure。 。 。 。 。 。Running handlers:Running handlers completeChef Client finished, 425/608 resources updated in 03 minutes 08secondsgitlab Reconfigured! 10.2.5 启动GitLab服务
启动gitlab服务gitlab-ctl start停止gitlab服务gitlab-ctl stop
[rootgitlab-server module]# gitlab-ctl startok: run: alertmanager: (pid 6105) 89sok: run: gitaly: (pid 5996) 91sok: run: gitlab-exporter: (pid 5988) 91sok: run: gitlab-workhorse: (pid 5958) 92sok: run: grafana: (pid 6128) 89sok: run: logrotate: (pid 5312) 182sok: run: nginx: (pid 5275) 188sok: run: node-exporter: (pid 5982) 92sok: run: postgres-exporter: (pid 6120) 89sok: run: postgresql: (pid 4909) 243sok: run: prometheus: (pid 6083) 91sok: run: puma: (pid 5133) 206sok: run: redis: (pid 4676) 255sok: run: redis-exporter: (pid 5990) 91sok: run: sidekiq: (pid 5164) 200s 10.2.6 使用浏览器访问GitLab Step1访问GitLab服务器 方式1IP地址访问默认端口为80可不写 192.168.171.200 方式2主机名访问 http://gitlab-server必须配置windows的hosts映射文件 注此处只能使用http不能使用https Step2设置root账户的密码 首次登陆之前需要修改下GitLab提供的root账户的密码密码要求8位以上包含大小写子母和特殊符号 Step3使用修改后的密码登录GitLab 10.3 创建远程库 Step1New Project → Create blank project Step2输入远程库名称 Step3查看效果 10.4 本地库推送到远程库 Step1添加远程仓库即本地仓库需要关联哪一个远程仓库 注gitlab 网页上复制过来的连接是http://gitlab.example.com/root/git-vscode.git需要手动修改为http://gitlab-server/root/git-vscode.git Step2本地库推送到远程库 Step3查看效果 只要GitLab的远程库连接定义好以后对GitLab远程库进行pull和clone的操作和Github和码云一致此处不再赘述。