私有仓库GitLab快速入门篇

                                     作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

  安装文档请参考官网:https://about.gitlab.com/installation/#centos-7。当然根据本篇博客的步骤走也是可以成功部署GitLab的哟。

一.GitLab简介

1>.什么是GitLab

  GitLab 是一个用于仓库管理系统的开源项目。使用Git作为代码管理工具,并在此基础上搭建起来的web服务。可通过Web界面进行访问公开的或者私人项目。它拥有与Github类似的功能,能够浏览源代码,管理缺陷和注释。可以管理团队对仓库的访问,它非常易于浏览提交过的版本并提供一个文件历史库。团队成员可以利用内置的简单聊天程序(Wall)进行交流。它还提供一个代码片段收集功能可以轻松实现代码复用。

 2>.常用的网站

  官网:https://about.gitlab.com/

  国内镜像:https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/

 3>.安装GitLab的操纵系统环境

[root@yinzhengjie ~]# cat /etc/redhat-release
CentOS Linux release 7.2. (Core)
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# free -m
total used free shared buff/cache available
Mem:
Swap:
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# uname -r
3.10.-.el7.x86_64
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# uname -m
x86_64
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ifconfig | grep broadcast | awk '{print $2}'
172.30.1.101
[root@yinzhengjie ~]#
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# cat /etc/hosts | grep 172.30.1.101
172.30.1.101 www.yinzhengjie.org.cn
[root@yinzhengjie ~]#

二.GitLab部署

1>.安装GitLab依赖包

[root@yinzhengjie download]# yum install -y curl policycoreutils-python openssh-server openssh-clients
Loaded plugins: fastestmirror
base | 3.6 kB ::
elasticsearch-.x | 2.9 kB ::
extras | 3.4 kB ::
mysql-connectors-community | 2.5 kB ::
mysql-tools-community | 2.5 kB ::
mysql56-community | 2.5 kB ::
updates | 3.4 kB ::
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* extras: mirrors.shu.edu.cn
* updates: mirrors.huaweicloud.com
Resolving Dependencies
--> Running transaction check
---> Package curl.x86_64 :7.29.-.el7.centos will be updated
---> Package curl.x86_64 :7.29.-.el7 will be an update
--> Processing Dependency: libcurl = 7.29.-.el7 for package: curl-7.29.-.el7.x86_64
---> Package openssh-server.x86_64 :6.6.1p1-.el7 will be updated
---> Package openssh-server.x86_64 :.4p1-.el7 will be an update
--> Processing Dependency: openssh = .4p1-.el7 for package: openssh-server-.4p1-.el7.x86_64
---> Package policycoreutils-python.x86_64 :2.5-.el7 will be installed
--> Processing Dependency: policycoreutils = 2.5-.el7 for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: setools-libs >= 3.3.- for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libsemanage-python >= 2.5- for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: audit-libs-python >= 2.1.- for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: python-IPy for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libselinux-python for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libqpol.so.(VERS_1.)(64bit) for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libqpol.so.(VERS_1.)(64bit) for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libcgroup for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libapol.so.(VERS_4.)(64bit) for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: checkpolicy for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libqpol.so.()(64bit) for package: policycoreutils-python-2.5-.el7.x86_64
--> Processing Dependency: libapol.so.()(64bit) for package: policycoreutils-python-2.5-.el7.x86_64
--> Running transaction check
---> Package audit-libs-python.x86_64 :2.8.-.el7_5. will be installed
--> Processing Dependency: audit-libs(x86-) = 2.8.-.el7_5. for package: audit-libs-python-2.8.-.el7_5..x86_64
---> Package checkpolicy.x86_64 :2.5-.el7 will be installed
---> Package libcgroup.x86_64 :0.41-.el7 will be installed
---> Package libcurl.x86_64 :7.29.-.el7.centos will be updated
---> Package libcurl.x86_64 :7.29.-.el7 will be an update
---> Package libselinux-python.x86_64 :2.5-.el7 will be installed
---> Package libsemanage-python.x86_64 :2.5-.el7 will be installed
--> Processing Dependency: libsemanage = 2.5-.el7 for package: libsemanage-python-2.5-.el7.x86_64
--> Processing Dependency: libsemanage.so.(LIBSEMANAGE_1.)(64bit) for package: libsemanage-python-2.5-.el7.x86_64
---> Package openssh.x86_64 :6.6.1p1-.el7 will be updated
--> Processing Dependency: openssh = 6.6.1p1-.el7 for package: openssh-clients-6.6.1p1-.el7.x86_64
---> Package openssh.x86_64 :.4p1-.el7 will be an update
---> Package policycoreutils.x86_64 :2.2.-.el7 will be updated
---> Package policycoreutils.x86_64 :2.5-.el7 will be an update
---> Package python-IPy.noarch :0.75-.el7 will be installed
---> Package setools-libs.x86_64 :3.3.-.el7 will be installed
--> Running transaction check
---> Package audit-libs.x86_64 :2.4.-.el7 will be updated
--> Processing Dependency: audit-libs = 2.4.-.el7 for package: audit-2.4.-.el7.x86_64
---> Package audit-libs.x86_64 :2.8.-.el7_5. will be an update
---> Package libsemanage.x86_64 :2.1.-.el7 will be updated
---> Package libsemanage.x86_64 :2.5-.el7 will be an update
---> Package openssh-clients.x86_64 :6.6.1p1-.el7 will be updated
---> Package openssh-clients.x86_64 :.4p1-.el7 will be an update
--> Running transaction check
---> Package audit.x86_64 :2.4.-.el7 will be updated
---> Package audit.x86_64 :2.8.-.el7_5. will be an update
--> Processing Conflict: libsemanage-2.5-.el7.x86_64 conflicts selinux-policy-base < 3.13.-
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package selinux-policy-targeted.noarch :3.13.-.el7 will be updated
---> Package selinux-policy-targeted.noarch :3.13.-.el7_5. will be an update
--> Processing Dependency: selinux-policy = 3.13.-.el7_5. for package: selinux-policy-targeted-3.13.-.el7_5..noarch
--> Processing Dependency: selinux-policy = 3.13.-.el7_5. for package: selinux-policy-targeted-3.13.-.el7_5..noarch
--> Running transaction check
---> Package selinux-policy.noarch :3.13.-.el7 will be updated
---> Package selinux-policy.noarch :3.13.-.el7_5. will be an update
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
policycoreutils-python x86_64 2.5-.el7 base k
Updating:
curl x86_64 7.29.-.el7 base k
openssh-server x86_64 .4p1-.el7 base k
selinux-policy-targeted noarch 3.13.-.el7_5. updates 6.6 M
Installing for dependencies:
audit-libs-python x86_64 2.8.-.el7_5. updates k
checkpolicy x86_64 2.5-.el7 base k
libcgroup x86_64 0.41-.el7 base k
libselinux-python x86_64 2.5-.el7 base k
libsemanage-python x86_64 2.5-.el7 base k
python-IPy noarch 0.75-.el7 base k
setools-libs x86_64 3.3.-.el7 base k
Updating for dependencies:
audit x86_64 2.8.-.el7_5. updates k
audit-libs x86_64 2.8.-.el7_5. updates k
libcurl x86_64 7.29.-.el7 base k
libsemanage x86_64 2.5-.el7 base k
openssh x86_64 .4p1-.el7 base k
openssh-clients x86_64 .4p1-.el7 base k
policycoreutils x86_64 2.5-.el7 base k
selinux-policy noarch 3.13.-.el7_5. updates k Transaction Summary
=============================================================================================================================================
Install Package (+ Dependent packages)
Upgrade Packages (+ Dependent packages) Total download size: M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(/): audit-2.8.-.el7_5..x86_64.rpm | kB ::
(/): curl-7.29.-.el7.x86_64.rpm | kB ::
(/): libcurl-7.29.-.el7.x86_64.rpm | kB ::
(/): audit-libs-2.8.-.el7_5..x86_64.rpm | kB ::
(/): libselinux-python-2.5-.el7.x86_64.rpm | kB ::
(/): libsemanage-python-2.5-.el7.x86_64.rpm | kB ::
(/): libcgroup-0.41-.el7.x86_64.rpm | kB ::
(/): openssh-.4p1-.el7.x86_64.rpm | kB ::
(/): checkpolicy-2.5-.el7.x86_64.rpm | kB ::
(/): openssh-server-.4p1-.el7.x86_64.rpm | kB ::
(/): policycoreutils-2.5-.el7.x86_64.rpm | kB ::
(/): python-IPy-0.75-.el7.noarch.rpm | kB ::
(/): policycoreutils-python-2.5-.el7.x86_64.rpm | kB ::
(/): libsemanage-2.5-.el7.x86_64.rpm | kB ::
(/): selinux-policy-3.13.-.el7_5..noarch.rpm | kB ::
(/): setools-libs-3.3.-.el7.x86_64.rpm | kB ::
(/): openssh-clients-.4p1-.el7.x86_64.rpm | kB ::
(/): selinux-policy-targeted-3.13.-.el7_5..noarch.rpm | 6.6 MB ::
audit-libs-python-2.8.-.el7_ FAILED
http://centos.ustc.edu.cn/centos/7.5.1804/updates/x86_64/Packages/audit-libs-python-2.8.1-3.el7_5.1.x86_64.rpm: [Errno 14] curl#7 - "Failed to connect to 2001:da8:d800:95::110: Network is unreachable"
Trying other mirror.
(/): audit-libs-python-2.8.-.el7_5..x86_64.rpm | kB ::
---------------------------------------------------------------------------------------------------------------------------------------------
Total kB/s | MB ::
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : audit-libs-2.8.-.el7_5..x86_64 /
Updating : libsemanage-2.5-.el7.x86_64 /
Updating : policycoreutils-2.5-.el7.x86_64 /
Updating : openssh-.4p1-.el7.x86_64 /
Updating : selinux-policy-3.13.-.el7_5..noarch /
Installing : libsemanage-python-2.5-.el7.x86_64 /
Installing : audit-libs-python-2.8.-.el7_5..x86_64 /
Installing : checkpolicy-2.5-.el7.x86_64 /
Installing : libcgroup-0.41-.el7.x86_64 /
Updating : libcurl-7.29.-.el7.x86_64 /
Installing : python-IPy-0.75-.el7.noarch /
Installing : libselinux-python-2.5-.el7.x86_64 /
Installing : setools-libs-3.3.-.el7.x86_64 /
Installing : policycoreutils-python-2.5-.el7.x86_64 /
Updating : curl-7.29.-.el7.x86_64 /
Updating : selinux-policy-targeted-3.13.-.el7_5..noarch /
Updating : openssh-server-.4p1-.el7.x86_64 /
Updating : openssh-clients-.4p1-.el7.x86_64 /
Updating : audit-2.8.-.el7_5..x86_64 /
Cleanup : selinux-policy-targeted-3.13.-.el7.noarch /
Cleanup : openssh-server-6.6.1p1-.el7.x86_64 /
Cleanup : selinux-policy-3.13.-.el7.noarch /
Cleanup : policycoreutils-2.2.-.el7.x86_64 /
Cleanup : libsemanage-2.1.-.el7.x86_64 /
Cleanup : openssh-clients-6.6.1p1-.el7.x86_64 /
Cleanup : openssh-6.6.1p1-.el7.x86_64 /
Cleanup : audit-2.4.-.el7.x86_64 /
Cleanup : curl-7.29.-.el7.centos.x86_64 /
Cleanup : libcurl-7.29.-.el7.centos.x86_64 /
Cleanup : audit-libs-2.4.-.el7.x86_64 /
Verifying : libsemanage-python-2.5-.el7.x86_64 /
Verifying : libsemanage-2.5-.el7.x86_64 /
Verifying : setools-libs-3.3.-.el7.x86_64 /
Verifying : audit-libs-python-2.8.-.el7_5..x86_64 /
Verifying : curl-7.29.-.el7.x86_64 /
Verifying : policycoreutils-2.5-.el7.x86_64 /
Verifying : audit-2.8.-.el7_5..x86_64 /
Verifying : openssh-server-.4p1-.el7.x86_64 /
Verifying : libselinux-python-2.5-.el7.x86_64 /
Verifying : policycoreutils-python-2.5-.el7.x86_64 /
Verifying : python-IPy-0.75-.el7.noarch /
Verifying : selinux-policy-targeted-3.13.-.el7_5..noarch /
Verifying : libcurl-7.29.-.el7.x86_64 /
Verifying : libcgroup-0.41-.el7.x86_64 /
Verifying : audit-libs-2.8.-.el7_5..x86_64 /
Verifying : openssh-.4p1-.el7.x86_64 /
Verifying : openssh-clients-.4p1-.el7.x86_64 /
Verifying : selinux-policy-3.13.-.el7_5..noarch /
Verifying : checkpolicy-2.5-.el7.x86_64 /
Verifying : curl-7.29.-.el7.centos.x86_64 /
Verifying : openssh-6.6.1p1-.el7.x86_64 /
Verifying : selinux-policy-targeted-3.13.-.el7.noarch /
Verifying : openssh-clients-6.6.1p1-.el7.x86_64 /
Verifying : libsemanage-2.1.-.el7.x86_64 /
Verifying : selinux-policy-3.13.-.el7.noarch /
Verifying : libcurl-7.29.-.el7.centos.x86_64 /
Verifying : openssh-server-6.6.1p1-.el7.x86_64 /
Verifying : audit-libs-2.4.-.el7.x86_64 /
Verifying : policycoreutils-2.2.-.el7.x86_64 /
Verifying : audit-2.4.-.el7.x86_64 / Installed:
policycoreutils-python.x86_64 :2.5-.el7 Dependency Installed:
audit-libs-python.x86_64 :2.8.-.el7_5. checkpolicy.x86_64 :2.5-.el7 libcgroup.x86_64 :0.41-.el7
libselinux-python.x86_64 :2.5-.el7 libsemanage-python.x86_64 :2.5-.el7 python-IPy.noarch :0.75-.el7
setools-libs.x86_64 :3.3.-.el7 Updated:
curl.x86_64 :7.29.-.el7 openssh-server.x86_64 :.4p1-.el7 selinux-policy-targeted.noarch :3.13.-.el7_5. Dependency Updated:
audit.x86_64 :2.8.-.el7_5. audit-libs.x86_64 :2.8.-.el7_5. libcurl.x86_64 :7.29.-.el7
libsemanage.x86_64 :2.5-.el7 openssh.x86_64 :.4p1-.el7 openssh-clients.x86_64 :.4p1-.el7
policycoreutils.x86_64 :2.5-.el7 selinux-policy.noarch :3.13.-.el7_5. Complete!
[root@yinzhengjie download]#

[root@yinzhengjie download]# yum install -y curl policycoreutils-python openssh-server openssh-clients

2>.下载GitLab的rpm包

[root@yinzhengjie ~]# cd download/
[root@yinzhengjie download]# ll
total
-rw-r--r-- root root Sep : apache-tomcat-9.0..tar.gz
[root@yinzhengjie download]#
[root@yinzhengjie download]#
[root@yinzhengjie download]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm
---- ::-- https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, :f000:::::
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:... connected.
HTTP request sent, awaiting response... OK
Length: (343M) [application/x-redhat-package-manager]
Saving to: ‘gitlab-ce-10.0.-ce..el7.x86_64.rpm’ %[===================================================================================================>] ,, .39MB/s in 4m 6s -- :: (1.39 MB/s) - ‘gitlab-ce-10.0.-ce..el7.x86_64.rpm’ saved [/] [root@yinzhengjie download]# ll
total
-rw-r--r-- root root Sep : apache-tomcat-9.0..tar.gz
-rw-r--r-- root root Nov gitlab-ce-10.0.-ce..el7.x86_64.rpm
[root@yinzhengjie download]#

[root@yinzhengjie download]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm

3>.通过yum本地安装GitLab

[root@yinzhengjie download]# yum -y localinstall gitlab-ce-10.0.-ce..el7.x86_64.rpm
Loaded plugins: fastestmirror
Examining gitlab-ce-10.0.-ce..el7.x86_64.rpm: gitlab-ce-10.0.-ce..el7.x86_64
Marking gitlab-ce-10.0.-ce..el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package gitlab-ce.x86_64 :10.0.-ce..el7 will be installed
--> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================
Installing:
gitlab-ce x86_64 10.0.-ce..el7 /gitlab-ce-10.0.-ce..el7.x86_64 1.0 G Transaction Summary
=============================================================================================================================================
Install Package Total size: 1.0 G
Installed size: 1.0 G
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : gitlab-ce-10.0.-ce..el7.x86_64 /
It looks like GitLab has not been configured yet; skipping the upgrade script. *. *.
*** ***
***** *****
.****** *******
******** ********
,,,,,,,,,***********,,,,,,,,,
,,,,,,,,,,,*********,,,,,,,,,,,
.,,,,,,,,,,,*******,,,,,,,,,,,,
,,,,,,,,,*****,,,,,,,,,.
,,,,,,,****,,,,,,
.,,,***,,,,
,*,. _______ __ __ __
/ ____(_) /_/ / ____ _/ /_
/ / __/ / __/ / / __ \`/ __ \
/ /_/ / / /_/ /___/ /_/ / /_/ /
\____/_/\__/_____/\__,_/_.___/ Thank you for installing GitLab!
GitLab was unable to detect a valid hostname for your instance.
Please configure a URL for your GitLab instance by setting `external_url`
configuration in /etc/gitlab/gitlab.rb file.
Then, you can start your GitLab instance by running the following command:
sudo gitlab-ctl reconfigure For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md Verifying : gitlab-ce-10.0.-ce..el7.x86_64 / Installed:
gitlab-ce.x86_64 :10.0.-ce..el7 Complete!
[root@yinzhengjie download]#

[root@yinzhengjie download]# yum -y localinstall gitlab-ce-10.0.6-ce.0.el7.x86_64.rpm

4>.修改GitLab的主配置文件

5>.初始化GitLab,就执行一次

[root@yinzhengjie download]# gitlab-ctl reconfigure

6>.管理GitLab服务的常用命令

[root@yinzhengjie download]# gitlab-ctl start
ok: run: gitaly: (pid ) 119s
ok: run: gitlab-monitor: (pid ) 118s
ok: run: gitlab-workhorse: (pid ) 119s
ok: run: logrotate: (pid ) 148s
ok: run: nginx: (pid ) 150s
ok: run: node-exporter: (pid ) 142s
ok: run: postgres-exporter: (pid ) 118s
ok: run: postgresql: (pid ) 188s
ok: run: prometheus: (pid ) 118s
ok: run: redis: (pid ) 194s
ok: run: redis-exporter: (pid ) 138s
ok: run: sidekiq: (pid ) 160s
ok: run: unicorn: (pid ) 162s
[root@yinzhengjie download]#

启动GitLab服务([root@yinzhengjie download]# gitlab-ctl start)

[root@yinzhengjie download]# gitlab-ctl status
run: gitaly: (pid ) 123s; run: log: (pid ) 162s
run: gitlab-monitor: (pid ) 122s; run: log: (pid ) 144s
run: gitlab-workhorse: (pid ) 123s; run: log: (pid ) 156s
run: logrotate: (pid ) 152s; run: log: (pid ) 152s
run: nginx: (pid ) 154s; run: log: (pid ) 154s
run: node-exporter: (pid ) 146s; run: log: (pid ) 146s
run: postgres-exporter: (pid ) 122s; run: log: (pid ) 134s
run: postgresql: (pid ) 192s; run: log: (pid ) 192s
run: prometheus: (pid ) 122s; run: log: (pid ) 136s
run: redis: (pid ) 198s; run: log: (pid ) 198s
run: redis-exporter: (pid ) 142s; run: log: (pid ) 142s
run: sidekiq: (pid ) 164s; run: log: (pid ) 164s
run: unicorn: (pid ) 166s; run: log: (pid ) 166s
[root@yinzhengjie download]#

查看GitLab的状态([root@yinzhengjie download]# gitlab-ctl status)

[root@yinzhengjie download]# gitlab-ctl stop
ok: down: gitaly: 0s, normally up
ok: down: gitlab-monitor: 1s, normally up
ok: down: gitlab-workhorse: 0s, normally up
ok: down: logrotate: 0s, normally up
ok: down: nginx: 1s, normally up
ok: down: node-exporter: 0s, normally up
ok: down: postgres-exporter: 1s, normally up
ok: down: postgresql: 0s, normally up
ok: down: prometheus: 1s, normally up
ok: down: redis: 0s, normally up
ok: down: redis-exporter: 0s, normally up
ok: down: sidekiq: 0s, normally up
ok: down: unicorn: 1s, normally up
[root@yinzhengjie download]#
[root@yinzhengjie download]#
[root@yinzhengjie download]#
[root@yinzhengjie download]# gitlab-ctl status
down: gitaly: 8s, normally up; run: log: (pid ) 690s
down: gitlab-monitor: 8s, normally up; run: log: (pid ) 672s
down: gitlab-workhorse: 7s, normally up; run: log: (pid ) 684s
down: logrotate: 7s, normally up; run: log: (pid ) 680s
down: nginx: 7s, normally up; run: log: (pid ) 682s
down: node-exporter: 6s, normally up; run: log: (pid ) 674s
down: postgres-exporter: 6s, normally up; run: log: (pid ) 662s
down: postgresql: 5s, normally up; run: log: (pid ) 720s
down: prometheus: 5s, normally up; run: log: (pid ) 664s
down: redis: 4s, normally up; run: log: (pid ) 726s
down: redis-exporter: 4s, normally up; run: log: (pid ) 670s
down: sidekiq: 3s, normally up; run: log: (pid ) 692s
down: unicorn: 3s, normally up; run: log: (pid ) 694s
[root@yinzhengjie download]#
[root@yinzhengjie download]#

停止GitLab服务([root@yinzhengjie download]# gitlab-ctl stop)

7>.通过webUI访问GitLab,设置初始密码

8>.登录GitLab

9>.登录成功后会有以下界面

10>.GitLab的安装和日志存放位置

[root@yinzhengjie download]# ll /opt/gitlab/
total
drwxr-xr-x root root Sep : bin
-rw-r--r-- root root Nov dependency_licenses.json
drwxr-xr-x root root Sep : embedded
drwxr-xr-x root root Sep : etc
drwxr-xr-x root root Sep : init
-rw-r--r-- root root Nov LICENSE
drwxr-xr-x root root Sep : LICENSES
drwxr-xr-x root root Sep : service
drwxr-xr-x root root Sep : sv
drwxr-xr-x root root Sep : var
-rw-r--r-- root root Nov version-manifest.json
-rw-r--r-- root root Nov version-manifest.txt
[root@yinzhengjie download]#

GitLab的安装位置([root@yinzhengjie download]# ll /opt/gitlab/)

[root@yinzhengjie download]# ll /var/log/gitlab/
total
drwx------ git root Sep : gitaly
drwx------ git root Sep : gitlab-monitor
drwx------ git root Sep : gitlab-rails
drwx------ git root Sep : gitlab-shell
drwx------ git root Sep : gitlab-workhorse
drwx------ root root Sep : logrotate
drwxr-x--- root gitlab-www Sep : nginx
drwx------ gitlab-prometheus root Sep : node-exporter
drwx------ gitlab-psql root Sep : postgres-exporter
drwx------ gitlab-psql root Sep : postgresql
drwx------ gitlab-prometheus root Sep : prometheus
drwxr-xr-x root root Sep : reconfigure
drwx------ gitlab-redis root Sep : redis
drwx------ gitlab-redis root Sep : redis-exporter
drwx------ git root Sep : sidekiq
drwx------ git root Sep : unicorn
[root@yinzhengjie download]#

GitLab的日志存放位置([root@yinzhengjie download]# ll /var/log/gitlab/)

[root@yinzhengjie ~]# ll /etc/gitlab/
total
-rw------- root root Sep : gitlab.rb
-rw------- root root Sep : gitlab-secrets.json
drwxr-xr-x root root Sep : trusted-certs
[root@yinzhengjie ~]#

GitLab配置文件存放目录([root@yinzhengjie ~]# ll /etc/gitlab/)

三.使用GitLab步骤详解

1>.点击新建项目

2>.编辑新建项目信息

3>创建项目成功后的界面

4>配置秘钥登录-点击“add an SSH key”

5>配置秘钥登录-将服务器端的秘钥id拷贝到GitLab的webUI界面上

  关于配置SSH免密码登录大家可以参考我以前的笔记:https://www.cnblogs.com/yinzhengjie/p/9065191.html。

6>.配置秘钥登录-配置成功的界面

7>.创建新仓库-查看帮助信息

8>.创建新仓库-克隆gitlab的项目到服务器本地

[root@yinzhengjie ~]# ll
total
drwxr-xr-x root root Sep : download
drwxr-xr-x root root Sep : git_data
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# git clone git@www.yinzhengjie.org.cn:root/yinzhengjieCode.git
Cloning into 'yinzhengjieCode'...
The authenticity of host 'www.yinzhengjie.org.cn (172.30.1.101)' can't be established.
ECDSA key fingerprint is SHA256:1MkICaFrw0jl80J9+gRJBa4W1QjDRafGqrFzRzae81E.
ECDSA key fingerprint is MD5:b6::e8:e7::d4:c2:4c:e0::7e:9c:d8::d8:.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'www.yinzhengjie.org.cn' (ECDSA) to the list of known hosts.
warning: You appear to have cloned an empty repository.
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# ll
total
drwxr-xr-x root root Sep : download
drwxr-xr-x root root Sep : git_data
drwxr-xr-x root root Sep : yinzhengjieCode
[root@yinzhengjie ~]#
[root@yinzhengjie ~]# cd yinzhengjieCode/
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# ll
total
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]#

[root@yinzhengjie ~]# git clone git@www.yinzhengjie.org.cn:root/yinzhengjieCode.git   #将gitlab的数据下载到本地服务器中

[root@yinzhengjie ~]# cd yinzhengjieCode/
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# ll
total
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# touch README.md
[root@yinzhengjie yinzhengjieCode]# echo http://www.cnblogs.com/yinzhengjie >> README.md
[root@yinzhengjie yinzhengjieCode]# git add README.md
[root@yinzhengjie yinzhengjieCode]# git commit -m "add README"
[master (root-commit) 64b2f56] add README
file changed, insertions(+), deletions(-)
create mode README.md
[root@yinzhengjie yinzhengjieCode]# git push -u origin master #将数据推送到gitlab中
Counting objects: , done.
Writing objects: % (/), bytes | bytes/s, done.
Total (delta ), reused (delta )
To git@www.yinzhengjie.org.cn:root/yinzhengjieCode.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]#

[root@yinzhengjie yinzhengjieCode]# git push -u origin master               #将数据推送到gitlab中

9>.在网页上编辑文件

10>.在网页上编辑完成后点击提交并查看修改后的内容

11>.在服务器端查看编译后的文件内容

[root@yinzhengjie yinzhengjieCode]# ll
total
-rw-r--r-- root root Sep : README.md
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# cat README.md
http://www.cnblogs.com/yinzhengjie
http://www.cnblogs.com/yinzhengjie
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# git pull
remote: Counting objects: , done.
remote: Compressing objects: % (/), done.
remote: Total (delta ), reused (delta )
Unpacking objects: % (/), done.
From www.yinzhengjie.org.cn:root/yinzhengjieCode
abe070d..a697c69 master -> origin/master
Auto-merging README.md
CONFLICT (content): Merge conflict in README.md
Automatic merge failed; fix conflicts and then commit the result.
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# ll
total
-rw-r--r-- root root Sep : README.md
[root@yinzhengjie yinzhengjieCode]#
[root@yinzhengjie yinzhengjieCode]# cat README.md
http://www.cnblogs.com/yinzhengjie
<<<<<<< HEAD
http://www.cnblogs.com/yinzhengjie
======= 尹正杰到此一游!!!! 大数据 自动化运维 人工智能 深度学习 >>>>>>> a697c6969dff86c6743060f0d829090508eb1243
[root@yinzhengjie yinzhengjieCode]#

私有仓库GitLab快速入门篇的更多相关文章

  1. Hadoop生态圈-Hive快速入门篇之HQL的基础语法

    Hadoop生态圈-Hive快速入门篇之HQL的基础语法 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 本篇博客的重点是介绍Hive中常见的数据类型,DDL数据定义,DML数据操作 ...

  2. Hadoop生态圈-大数据生态体系快速入门篇

    Hadoop生态圈-大数据生态体系快速入门篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.大数据概念 1>.什么是大数据 大数据(big data):是指无法在一定时间 ...

  3. Java基础-SSM之Spring快速入门篇

    Java基础-SSM之Spring快速入门篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.    Spring是一个开源框架,Spring是于2003 年兴起的一个轻量级的Java ...

  4. Java基础-SSM之mybatis快速入门篇

    Java基础-SSM之mybatis快速入门篇 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 其实你可能会问什么是SSM,简单的说就是spring mvc + Spring + m ...

  5. Hadoop生态圈-Hive快速入门篇之Hive环境搭建

    Hadoop生态圈-Hive快速入门篇之Hive环境搭建 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.数据仓库(理论性知识大多摘自百度百科) 1>.什么是数据仓库 数据 ...

  6. Springboot快速入门篇,图文并茂

    Springboot快速入门篇,图文并茂 文章已托管到GitHub,大家可以去GitHub查看阅读,欢迎老板们前来Star!搜索关注微信公众号 [码出Offer] 领取各种学习资料! image-20 ...

  7. Spring系列22:Spring AOP 概念与快速入门篇

    本文内容 Spring AOP含义和目标 AOP相关概念 声明式AOP快速入门 编程式创建代理对象 Spring AOP含义和目标 OOP: Object-oriented Programming 面 ...

  8. 私有仓库 gitlab 部署笔记

    --------------------------------------------gitlab简介------------------------------------------------ ...

  9. Angular快速入门篇

    简介 AngularJS 是一个为动态WEB应用设计的结构框架,提供给大家一种新的开发应用方式,这种方式可以让你扩展HTML的语法,以弥补在构建动态WEB应用时静态文本的不足,从而在web应用程序中使 ...

随机推荐

  1. C语言 · 奇偶判断

    问题描述 能被2整除的数称为偶数,不能被2整除的数称为奇数.给一个整数x,判断x是奇数还是偶数. 输入格式 输入包括一个整数x,0<=x<=100000000. 输出格式 如果x是奇数,则 ...

  2. c/c++面试题(9)linux方向

    1.简述用虚函数实现的多态的原理: 编译器发现一个类中有虚函数的时候,便会立即为此类生成虚函数表vtable.虚函数表的各 表项为指向对应虚函数的指针.编译器还会在此类中隐含插入一个指针vptr(对v ...

  3. while的使用

    我在用while的时候, while(当这个对象的首个字是汉字){ 执行语句 } 我发现出现死循环的现象 其实我要再添加一个条件,就是不管是不是上述条件都成立,最终还是要结束的.

  4. U3D 背景音效和事件触发音效

    首先,想要在一个游戏添加背景音乐其实很简单,就是利用一个组件 就能够实现音频的播放,不过要实现通过某一个事件,来进行声音的播放,比如跳跃啊什么的: public AudioClip jumpclips ...

  5. 使用INTERVAL YEAR TO MONTH类型

    Oracle Database 9i数据库引入了一种新特性,可以用来存储时间间隔.时间间隔的例子包括: ● 1年零3个月 ● 25个月 ● -3天5小时16分 ● 1天7小时 ● -56小时 注意: ...

  6. springmvc配置aop

    直接看代码 springmvc中的配置aop对 controller和它的子包进行拦截 springmvc中的配置 <!--xml头部配置需要有这几行代码--> xmlns:aop=&qu ...

  7. uploadifive源码学习

    一.简介 Uploadify是一个基于JQuery的多文件上传JS组件,高度定制,两个版本可供选择.flash版本在最新的Safari等不再支持flash的浏览器或者一些手机浏览器中就无法正常的加载使 ...

  8. spring data jpa自定义bean字段映射

    当遇到复杂多表查询时,并且同时还需要确保查询性能,此时则需要使用自定义sql查询,然而spring data jpa对于自定义sql则需使用查询需要在对应的bean中做太多的配置映射,我尝试了一下,最 ...

  9. JavaScript注释之HTML注释(<!-- & //-->)

    JavaScript中支持HTML注释 //用法 <script language="javascript"> <!-- alert("我是注释内的JS ...

  10. rownum用法

    对于rownum来说它是oracle系统顺序分配为从查询返回的行的编号,返回的第一行分配的是1,第二行是2,依此类推,这个伪字段可以用于限制查询返回的总行数,且rownum不能以任何表的名称作为前缀. ...