Jenkins and Gitlab install a integrated Git Extensions

GitLab by GitLabInc. Developed, using the MIT license web-based Git repository management tools, and has a wiki and issue tracking. Using Git as a code management tool, and built up on the basis of web services. GitLab developed by Ukrainian programmers DmitriyZaporozhets and ValerySizov, that uses language written in Ruby. Later, some parts rewritten by the Go language. July 2013, the products are split into: GitLabCE (Community Edition) and GitLabEE (Enterprise Edition), when the license GitLabCE and GitLabEE is still distributed under the MIT license for free and open source software. As of May 2018, the company has about 290 team members, and more than 2,000 open source contributor. GitLab used IBM, Sony, NASA, Alibaba, Invincea, O'ReillyMedia, Leibniz-Rechenzentrum (LRZ), CERN, SpaceX and other organizations.

Environmental
CentOS 7
Docker

Installation GitLab

Reference Gitlab official installation documentation: https://docs.gitlab.com/omnibus/docker/

# docker pull gitlab/gitlab-ce

Under the state run firewalld open container, otherwise there will be the following error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint gitlab (3fed4f9108cf49ecd38e93a9d7692ba6ee66d4ba4d5b8d4c455766b30753a621):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9443 -j DNAT --to-destination 172.17.0.2:443 ! -i docker0: iptables: No chain/target/match by that name.

Run container:

# docker run --detach --hostname gitlab.example.com --publish 9443:443 --publish 9082:80 --name gitlab --restart always  -v $HOME/gitlab/config:/etc/gitlab  -v $HOME/gitlab/logs:/var/log/gitlab -v $HOME/gitlab/data:/var/opt/gitlab  gitlab/gitlab-ce

At this visit http://192.168.159.129:9082 502 if an error occurs
Here Insert Picture Description
click Go back.
Generally it is not enough server performance, memory is too small.
Port occupancy.

You will enter the normal login page
to create a password for
Here Insert Picture Description
the default username: root

Password at least 8 characters

If you do not accustomed to English can also set the language: Click on picture - "setting-" Preferences- "Lanuage
Here Insert Picture Description

In order to connect with Jenkins We need an API Token. The default is our own generation of a no.
Here Insert Picture Description
Click to create token.
Here Insert Picture Description
Connected with Jenkins also need Gitlab of Global config (global configuration);
if not, then there will be displayed in the new project.
Here Insert Picture Description

Git 全局设置
git config --global user.name "Administrator"
git config --global user.email "[email protected]"

The third information needed in Docker Gitlab IP within the network.
Only within the container network addresses to access another vessel default mode network Docker containers.

Can use:

# docker inspect gitlab

View inside the container network address
Here Insert Picture Description
three information we Gitlab and Jenkins connected now have.
Token API
Git, Ltd. Free Join config
gitlab of docker IP

Installation Jenkins

Jenkins is a (continuous integration & deployment continued) software, used to automate a variety of tasks, continuous monitoring duplication of work, including the build, test and deploy Java-based software development of open source CI & CD. Jenkins support various operation modes, the Java program can be a separate package through the system, or by Docker. Jenkins is a very strong expansion of the software, its main function is to extend through plug-ins.

Installation procedures and command reference Jenkins official document: https://jenkins.io/zh/doc/book/installing/

Jenkins also installed with Docker open firewalld.

# docker pull jenkinsci/blueocean

Create a container

docker run -u root --rm -d -p 9081:8080 -p 50000:50000 -v $HOME/jenkins:/var/jenkins_home jenkinsci/blueocean

Configuration Jenkins

Jenkins access from the client's browser.

Here Insert Picture Description
Jenkins default administrator password
Here Insert Picture Description

After logging in will let you choose to install Plugin. In this case the first option to skip it.
Here Insert Picture Description
Create an account
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description

Jenkins connection configuration of the Gitlab

Git plugin and Gitlab plugin required plug-ins.
Three information required when installing Gitlab of: API Token, Git Global config, Docker IP

Configuration Gitlab plugin

If you search available where less than it should be already installed.
Here Insert Picture Description
Here Insert Picture Description
That appears Success successful installation.

First configure Gitlab
Here Insert Picture Description
Here Insert Picture Description
after a successful test to click Apply and then click Save.
Here Insert Picture Description

Git plugin configuration of Global config

Here Insert Picture Description

Gitlab new projects to increase membership and configure SSH keys

Here Insert Picture Description
Git Extensions to open the main panel
Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description

Here Insert Picture Description
Here Insert Picture Description

Here Insert Picture Description
Remote file repository can set the key, push protocol, etc.
Here Insert Picture Description
Here Insert Picture Description
This error should be because the domain name server is not configured caused.
Here Insert Picture Description

Published 48 original articles · won praise 8 · views 10000 +

Guess you like

Origin blog.csdn.net/wangxudongx/article/details/96725277