Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Pre-environment deployment installation for continuous deployment of Centos7 gitlab and jenkin

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Pre-environment deployment installation for continuous deployment of Centos7 gitlab and jenkin part 1 gitlab

Frontier part: gitlab installation is divided into two versions 1. Enterprise version of gitlab-ee and 2. Community gitlab-ce. The difference is that the community version is free. Here we are talking about the installation of the community version, and the enterprise version can be used as a reference.

Before we get to the point, let's talk about the advantages of git:

Git distributed version control system does not have a "central server" at all, and there is a complete version library on everyone's computer. The Git branch is different from the SVN branch. In SVN, the branch is actually a copy in the version repository, while a git repository is a snapshot, so git switching, merging branches and other operations are faster. GitLab introduction

GitLab: is an online code warehouse agent software based on Git. You can use gitlab to build a system similar to Github, which is generally used to build git private servers in enterprises, schools and other internal networks.

Function: Gitlab is a code management platform that provides code storage, submission review and problem tracking. It is very important for software engineering quality management.

Configuration: CPU 2 core is recommended, memory is more than 2G.

1. Installation depends on sudo yum install curl policycoreutils openssh-server openssh-clients policycoreutils-pythonsudo systemctl enable sshdsudo systemctl start sshdsudo yum install postfixsudo systemctl enable postfixsudo systemctl start postfix2. Yum configuration image acceleration official source address: https://about.gitlab.com/downloads/#centos6 Tsinghua University Image Source: https://mirror.tuna.tsinghua.edu.cn/help/gitlab-cevi / etc/yum.repos.d/gitlab_gitlab-ce.repo [gitlab-ce] name=Gitlab CE Repositorybaseurl= https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/gpgcheck=0enabled=13. Update local cloud cache

Sudo yum makecache

4. Installation

Sudo yum install gitlab-ce

5. Modify configuration item sudo vim / etc/gitlab/gitlab.rb replication code # modify configuration item external_url:http:// native ip replication code sudo gitlab-ctl reconfigure # reconfigure service; 5. Restart gitlab

Gitlab-ctl restart

6. Configure password-free login

The client command line generates ssh

Ssh-keygen-t rsacat ~ / .ssh/id_rsa.pub

Just copy it to User Settings > SSH Keys. As shown below:

The second part is jenkinsjenkins introduction.

Jenkins is a continuous integration tool based on Java, which is used to monitor continuous repetitive work. It aims to provide an open and easy-to-use software platform and make continuous integration of software possible.

Automated deployment flowchart:

What is continuous integration? Continuous integration (Continuous Integration,CI) code merging, building, deploying, testing together, continuously performing this process and feedback on the results (Continuous Deloyment,CD) deployment to production environment continuous delivery (Continuous Delivery,CD) deployment to production environment DevOps is a complete IT-oriented operation and maintenance workflow based on IT automation and continuous integration (CI) and continuous deployment (CD). To optimize program development, testing, system operation and maintenance and other aspects of 1. Java environment required to install jenkins (1) it is best to install jdk above java8

Download link: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

When downloading, you will be prompted to register if your Oracle account does not have one.

Choose the corresponding jdk according to your operating system. Here I choose the 8u231 version.

Note: be sure to log in to the Oracle user and select the accept license agreement option in the image, otherwise you need license authorization to download it.

After downloading to the local file name: jdk-8u231-linux-x64.tar.gz.

Cd / usr/local/src

Upload jdk1.8.0_211.tar only server this directory # extract files tar-xzvf jdk1.8.0_211.tar.gz create directory mkdir / usr/java extract files copy cp-r / usr/local/src/jdk1.8.0_211 / usr/javaln-s / usr/java/jdk1.8.0_211/bin/java / usr/bin/java (2) configure environment variables: vi / etc/profile# tail add the following Allow the JAVA_HOME=/usr/java/jdk1.8.0_211export CLASSPATH=.:$ {JAVA_HOME} / jre/lib/rt.jar:$ {JAVA_HOME} / lib/dt.jar:$ {JAVA_HOME} / lib/tools.jarexport PATH=$PATH:$ {JAVA_HOME} / bin (3) configuration file to take effect

Source / etc/profile

# Environment variables take effect

Java-version

2.jenkins (1) install wget-O / etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.reporpm-- import https://pkg.jenkins.io/redhat-stable/jenkins.io.keyyum install-y jenkins (2) close firewall systemctl stop firewalld.servicesystemctl disable firewalld.service3) configuration file vi / etc/sysconfig/jenkins # modify the following JENKINS_USER= "root". Port set to occupied JENKINS_PORT= "xxxx" (4) start jenkinssystemctl daemon-reloadsystemctl start jenkinssystemctl status jenkins

Seeing the status above indicates that the startup is successful. Access to the jenkins: http://ip:xxxx port to start jenkins.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report