就是那个胖子 2020-04-20
登录服务器做预配置
firewalld
以及开机自启动[ ~]# yum -y install curl policycoreutils openssh-server openssh-client postfix vim curl-devel [ ~]# curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash [ gitlab]# sudo systemctl start postfix && sudo systemctl enable postfix [ ~]# yum -y install gitlab-ce
[ ~]# openssl genrsa -out "/etc/gitlab/ssl/gitlab.yeecall.cn.key" 2048 [ ~]# openssl req -new -key "/etc/gitlab/ssl/gitlab.yeecall.cn.key" -out "/etc/gitlab/ssl/gitlab.yeecall.cn.csr" [ ~]# openssl x509 -req -days 3650 -in "/etc/gitlab/ssl/gitlab.yeecall.cn.csr" -signkey "/etc/gitlab/ssl/gitlab.yeecall.cn.key" -out "/etc/gitlab/ssl/gitlab.yeecall.cn.crt" [ ~]# openssl dhparam -out /etc/gitlab/ssl/dhparams.pem 2048 [ ~]# chmod 600 /etc/gitlab/ssl/* -rw------- 1 root root 424 Dec 22 22:44 /etc/gitlab/ssl/dhparams.pem -rw------- 1 root root 1298 Dec 22 22:42 /etc/gitlab/ssl/gitlab.yeecall.cn.crt -rw------- 1 root root 1082 Dec 22 22:40 /etc/gitlab/ssl/gitlab.yeecall.cn.csr -rw------- 1 root root 1675 Dec 22 22:38 /etc/gitlab/ssl/gitlab.yeecall.cn.key [ ~]# vim /etc/gitlab/gitlab.rb external_url ‘https://gitlab.yeecall.cn‘ nginx[‘redirect_http_to_https‘] = true nginx[‘ssl_certificate‘] = "/etc/gitlab/ssl/gitlab.yeecall.cn.crt" nginx[‘ssl_certificate_key‘] = "/etc/gitlab/ssl/gitlab.yeecall.cn.key" nginx[‘ssl_dhparam‘] = "/etc/gitlab/ssl/dhparams.pem" [ ~]# gitlab-ctl reconfigure [ ~]# vim /var/opt/gitlab/nginx/conf/gitlab-http.conf server_name gitlab.yeecall.cn; rewrite ^(.*)$ https://$host$1 permanent; [ ~]# gitlab-ctl restart
wanghuideMBP:Desktop wanghui$ mkdir repo wanghuideMBP:Desktop wanghui$ cd repo/ wanghuideMBP:repo wanghui$ git -c http.sslVerify=false clone https://gitlab.yeecall.cn/root/test-repo.git wanghuideMBP:test-repo wanghui$ vim test.py wanghuideMBP:test-repo wanghui$ git add . wanghuideMBP:test-repo wanghui$ git commit -m "first commit"wanghuideMBP:test-repo wanghui$ git -c http.sslVerify=false push origin master
开发视角的Gitlab
运维视角的Gitlab
演示使用方法
[ repo]# git -c ssl.Verify=false clone https://gitlab.yeecall.cn/root/test-repo.git #使用dev克隆代码 [ repo]# cd test-repo/ [ test-repo]# git checkout -b release-1.0 #创建分支 [ test-repo]# vim test.py #更改代码 print("this is a test code") print("this is a test code for release-1.0") [ test-repo]# git add . [ test-repo]# git commit -m "release-1.0" [ test-repo]# git -c http.sslVerify=false push origin release-1.0 #同步代码
用dev用户登陆gitlabweb页面,然后提出merge请求
创建merge请求
lead用户登陆gitlab批准合并请求。