Go gitlab

gitlab build

-y install curl the policycoreutils-yum Python OpenSSH-Server postfix
systemctl enable postfix
systemctl Start postfix
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash sudo
yum -Y-CE gitlab the install
gitlab the reconfigure-CTL
gitlab-CTL Status
Check mounting position
RPM -pql gitlub

Vim /etc/gitlab/gitlab.rb
external_url 'http://192.168.177.139'
gitlab the restart-CTL


login password to modify, no less than eight

the Command Line Instructions
by You CAN Also the Upload a using existing Files from your Computer at The Instructions below.



Git global setup
git config --global user.name "Administrator"
git config --global user.email "[email protected]"

提交代码
Create a new repository
git clone http://gitlab.example.com/root/developer-1.git
cd developer-1
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

Push an existing folder
cd existing_folder
git init
git remote add origin http://gitlab.example.com/root/developer-1.git
git add .
git commit -m "Initial commit"
git push -u origin master

Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin http://gitlab.example.com/root/developer-1.git
git push -u origin --all
git push -u origin --tags





git
yum -y install gcc openssl openssl-devel curl curl-devel unzip perl perl-devel expat expat-devel zlib zlib-devel asciidoc xmlto gettext-devel openssh-clients
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

useradd -r -s /bin/bash -d /home/git git
mkdir /home/git
chown git:git /home/git/ -R

tar xf git-2.9.5.tar.xz
cd git-2.9.5
./configure --prefix=/usr/local/git --with-openssl --with-libpcre
make -j 2 && make -j 2 install

echo "export PATH=/usr/local/git/bin/:$PATH" > /etc/profile.d/git.sh
source !$

cat / etc / passwd to / bin / bash read as follows
Git: X: 496: 496 :: / Home / Git: / usr / local / Git / bin / Git the shell-

CD / usr / local / Git / Share
LN - man sv / / usr / report this content share /

git --version

 

Combat: for enterprises to build Gitlab software version management server

 

 

Preparation:

1, transferred to physical memory. 6G, and is not installed, the low memory error.

2, ahead uploaded to gitlab-ce-10.2.3-ce.0.el7.x86_64.rpm uploaded to the linux system, do:

[xuegod63 the root @ ~] # RPM -ivh  time gitlab-ce-10.2.3-ce.0.el7.x86_64.rpm # installed too  

3. Place the downloaded git finished patch gitlab-patch-zh.tat.gz upload to linux

 

This section is to talk:

14.1 gitlab Overview

14.2 build GitLab platform and method of use

14.3 centos7 deployment finished version gitlab

14.3 install git client uses gitlab

14.4 combat: Use gitlab management website source code

14.1 Gitlab Overview

14.1.1 Gitlab Overview

GitLab Overview:

Is a use of Ruby on Rails development of open source applications to achieve a self-hosted Git repository project, accessible public or private projects via the Web interface.

Ruby on Rails is that one can make you develop, deploy and maintain web applications become simple framework.

GitLab and Github has similar features to browse the source code management deficiencies and comments. Management team can access to the repository, it is very easy to browse submitted version of the file and provides a historical repository. It also provides a snippet collection functions can easily achieve code reuse, to facilitate future need time to find out.

 

GitLab official website: https://about.gitlab.com/

 

Github Overview: gitHub is a hosting platform for open source and proprietary software projects, because only git hosting support as the sole repository format, named gitHub.

Official website: https://github.com/

 

Example:

gitlab 例1: https://gitlab.com/xhang/gitlab.git   

github例2:https://github.com/pld-linux/extundelete

 

14.1.3   gitlab and GitHub difference

GitLab and GitHub What is the difference?  Does not: 1 will be: 6

 

Similarities : Both are based on web Git repository, GitHub is modeled largely GitLab to do, they all provide a platform for sharing open source project, providing storage for the development team, share, publish, and cooperative development projects the centralized cloud storage places.

difference:

1, GitHub if you want to use private warehouse, is the need to pay . GitLab can create private free warehouse on it.

2, GitLab development team for their code repository have more control compared to GitHub, it has many features: Allows free warehouse setting permissions; allows users to select a project to share part of the code; allows users to set the project acquire rights to further enhance security; can be set to get the team to improve the overall progress; by innersourcing let people not within the purview not visit the resource.

From the code in terms of private point of view, sometimes companies do not want employees to get to all of the code, this time GitLab is undoubtedly the better choice. But for the purposes of open source projects, GitHub code hosting is still the first choice.

 

git Related concepts:

git is a version control system, is a command, is a tool

gitlib is used to implement development library functions git

github is based on a line of code to achieve git repository hosting, including a web interface, open to the Internet

gitlab is based on online code repository git hosting software implementation, generally used in the enterprise network to build git PW

Note:  gitlab-ce Community Edition ;  gitlab-EE Enterprise Edition costs

 

14.2 build GitLab platform

Experimental environment: centos7.4   virtual machine needs 6G, otherwise running late, the memory is not enough, direct error. 

14.2.1 install components Gitlab need:

[root@xuegod63 ~]# mv /etc/yum.repos.d/CentOS-* /opt/

[root@xuegod63 ~]#yum install curl policycoreutils openssh-server openssh-clients postfix  -y

By default, use Postfix to send mail

[root@xuegod63 ~]#systemctl enable postfix 

[root@xuegod63 ~]#systemctl start postfix

[xuegod63 the root @ ~] # iptables -F   # empty rule

[root@xuegod63 ~]# systemctl stop firewalld

[root@xuegod63 ~]# systemctl disable firewalld

 

14.2 2 Installation gitlab:  

The downloaded package gitlab-ce-10.2.3-ce.0.el7.x86_64.rpm uploaded to the linux system.

[root@xuegod63 ~]# rpm -ivh gitlab-ce-10.2.3-ce.0.el7.x86_64.rpm

 

Configuration and start GitLab

[xuegod63 the root @ ~] # gitlab the reconfigure-CTL   # reconfiguring the application. Equivalent to initialize it

 

 

[root@xuegod63 ~]# gitlab-ctl status   

# You can use gitlab-ctl management gitlab, such as viewing gitlab status:

run: gitlab-workhorse: (pid 3275) 169s; run: log: (pid 3151) 280s

run: logrotate: (pid 3169) 273s; run: log: (pid 3168) 273s

run: nginx: (pid 3157) 279s; run: log: (pid 3156) 279s

run: postgresql: (pid 3009) 349s; run: log: (pid 3008) 349s

run: redis: (pid 2926) 360s; run: log: (pid 2925) 360s

run: sidekiq: (pid 3142) 287s; run: log: (pid 3141) 287s

run: unicorn: (pid 3110) 293s; run: log: (pid 3109) 293s

 

[root@xuegod63 config]# netstat  -antup | grep  :80

tcp        0      0 127.0.0.1:8080          0.0.0.0:*           LISTEN      10864/unicorn maste

tcp        0      0 0.0.0.0:80              0.0.0.0:*            LISTEN      10729/nginx: master

This gitlab has been installed successfully! ! !

Default nginx as a web server.

 

Access: http://192.168.1.63 # first opened, slightly slower

Troubleshooting: installed gitlab later, reported the following error:

 

Note: if the latter when accessing the web interface, reported 502 total, should clear the firewall rules, additional memory is greater than 4G, and not out of memory, also reported 502 errors, because of insufficient memory can cause very slow, so the response timeout.

 

 

solve:

[xuegod63 the root @ ~] # iptables -F    # empty rule

[root @ xuegod63 ~] # as Free -m    # already use more than 4G memory

              total        used        free      shared  buff/cache   available

Mem:        5817        4187         133          80        1496        1198

 

 

14.2.3 Login gitlab

http://192.168.1.63/users/sign_in user: root password:  xuegod.cn       first login gitlab, need to modify the password for the root user, the root user is gitlab super administrator, enter a new password: xuegod.cn     

 

 

login successful. This gitlab build success.

 

 

14.2.4 Management gitlab

Close gitlab: # gitlab-ctl stop

Start gitlab: # gitlab-ctl start

Restart gitlab: # gitlab-ctl restart

Ultimately, gitlab is installed:

[root@xuegod63 ~]# ls /opt/gitlab/

 

 

[root @ xuegod63 ~] # vim /etc/gitlab/gitlab.rb    # modify gitlab external access address

Change: 13 is external_url 'http://gitlab.example.com'

To: 13 external_url 'http://192.168.1.63' Note: This must be changed, then the latter is not accessible to the user address is: http://gitlab.example.com/ xxxx, simply can not access. After modifying get is: http://192.168.1.63/ xxxx

Restart gitlab:

[root@xuegod63 ~]# gitlab-ctl restart

This gitlab has been successfully installed.

 

14.2.5 combat: centos7 deployment finished version gitlab

Place the downloaded git finished patch gitlab-patch-zh.tat.gz upload to linux

 

[root@xuegod63 ~]# tar zxvf gitlab-patch-zh.tat.gz

 

Method 2: download from external network

[Root @ gitlab ~] #git clone https://gitlab.com/xhang/gitlab.git # Download Freeware

[Root @ gitlab ~] # cat / root / gitlab / VERSION # to see the finished patch version, and I also installed 10.2.3.

 

1, stop the service gitlab

[root@xuegod63 ~]# gitlab-ctl stop

 

2, switch to the directory where the gitlab localization (i.e., two step acquisition finished version gitlab)

cd /root/gitlab

3, comparing the difference between the original version and the Chinese version before, and to derive differentiated files in / root

[root@xuegod63 gitlab]# git  diff  v10.2.3  v10.2.3-zh  > ../10.2.3-zh.diff

 

 4, the update to 10.2.3-zh.diff patch as gitlab

[@ xuegod63 the root gitlab] Patch # -d / opt / gitlab / Embedded /-Service / gitlab-Rails -p1 </ the root / 10. 2 . . 3 -zh.diff      stored on web pages at the front end of the relevant catalog #

[root @ xuegod63 gitlab] # gitlab-ctl restart    # restart the service

5, log on Chinese version:

http://192.168.1.63/

 

 

 

14.2.6 combat: Use gitlab management website source code

First, the new project

Second, create a user

Third, reset user passwords

Fourth, delete users

 

First, the new project

1, before the new project, create a group project where (that is to say the project file is stored in which the group)

Select the Admin area

 

2, select Groups - New Group

http://192.168.1.63/projects/new

 

 

 

4, New Projcet select the Create , then enter the name of the project, while the select group just created in the namespace 

www.xuegod.cn web Code

 

 

 

 

Second, create a user

1. Select the Admin area

 

2, select Users - New User

 

3, where Name is the other side of the Chinese name, Username is the login user name, generally can be set to prefix mailboxes, Email mailbox for the company .

 

 

5, the project now defaults to create a normal user.

7, after the completion of information input, User selected the Create . Basic information can not write. I have a profile picture \ Users \ shen \ Desktop \ test merge two mp4 files mp4box-Linux \ under: C

 

 

Third, reset the newly created user jianmingbasic's password

Login e-mail: [email protected]

 

Opening the initial set their own password: password must be 8 to a on. I have here is: 1273815479

 

After generating the password, login:

 

 

 

Method 2: Change Password

1. Select Area Admin  - "Users -" selected by the user - "Edit

 

Set a new password is: xuegod.cn

 

After the save point.

 

4, using the login jianmingbasic http://192.168.1.63/ time, will pop up to change the password options:  

 

 

Fourth, delete users

When leaving the other time, for safety reasons, you need to remove each other's gitlab authority, to avoid loss of confidential information, methods of operation as follows:

1. Select Area Admin , select the User , Delete User . We are here  

 

 

Fifth, add a file in the project index.html.

http://192.168.1.63/xuegod/xuegod-web to login root account   

 

 

 

14.3 install git client uses gitlab

Installation git clone 14.3.1 and the code

# yum install git  -y

HTTP git clone #: // 192.168.1.63 /xuegod/xuegod-web.git      # download, available here

 

 

You can also use the http protocol to download:

 

[root@xuegod63 test]# git clone http://192.168.1.63/xuegod/xuegod-web.git

N cloned into 'xuegod-web' ...

For username 'http://192.168.1.63': jianmingbasic               # Enter account gitlab

For Password 'HTTP: //[email protected]':  xuegod.cn # password

View files downloaded from:

[root@xuegod63 test]# ls xuegod-web/ -a

.  ..  .git  index.html

 

 

to sum up:

14.1 gitlab Overview

14.2 build GitLab platform and method of use

14.3 centos7 deployment finished version gitlab

14.3 install git client uses gitlab

14.4 combat: Use gitlab management website source code

 

windows client download: https://git-scm.com/downloads

Guess you like

Origin www.cnblogs.com/carl007/p/11367416.html
Go