Linux environment structures (b) - jenkins + gitlab arranged Jenkins build environment (1) - Download and installation

 Configuring jenkins + gitlab environment, need to rely on java environment, in the previous post, has been configured java environment, so you can directly set up the environment to these two tools.

jenkins Configuration

jenkins the configuration, as in the previous manner to build windows, installed mounting package may be used, may be installed using a web application. web applications need to have a way tomcat environment, these are some pre-conditions.

installation steps

Introduced today is the use of command to download the installation package installed, detailed as follows:

1. Access Download jenkins: https://pkg.jenkins.io/debian-stable/ , page includes installation steps described, particular installation package can be downloaded, by using a command to install

2. In linux terminal execute the command: wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo APT the Add-Key -

3. On the plus /etc/apt/sources.list: deb http://pkg.jenkins-ci.org/debian binary /

4. Run the update package in linux terminal: sudo apt-get update

5. Run the linux terminal mounting jenkins: sudo apt-get install jenkins

After performing the steps above, you need to wait for some time, the background to automatically install jenkins, will enter the administrator password, each different path.

After entering your password, you will choose the plug-in installed, I chose the default installation, you can view detailed before Bowen: Jenkins environmental structures (1) - Download and install . The next job is to wait for success, and this will be the effort, you can drink tea, chat.

Eventually set up an administrator account and access address, you can set this by yourself.

Profile Settings

Since the default port jenkins is 8080, you should install more then the default port will be repeated occupied, so you can modify the port, as follows:

1. Use the command / etc / default / jenkins open the configuration file vim

2. Locate HTTP_PORT this configuration item

3. Use vim editor commands modify the port number and save

4. Restart jenkins service: systemctl restart jenkins

You can view the log if successfully enabled: tail -f /var/log/jenkins/jenkins.log

After enabling the service, by ip + port access as follows:

This, jenkins build on success, and can be used as normal.

gitlab Configuration

GitLab is a warehouse management system for open source projects using Git as a code management tool, and build up on the basis of web services. Many do not need to introduce the role we all know, the next will introduce the configuration process.

gitlab installation

1. Access gitlab Download: https://packages.gitlab.com/gitlab/gitlab-ce , see the specific version details page, you can see the corresponding installation command

2. Enter the command in linux terminal: curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash

3. Enter command linux terminal: sudo yum install gitlab-ce- 11.9.8-ce.0.el7.x86_64 --content-Disposition or wget https://packages.gitlab.com/gitlab/gitlab-ce/packages /el/7/gitlab-ce-11.9.8-ce.0.el7.x86_64.rpm/download.rpm

4.等待后台下载安装包,并自动安装

5.安装成功后出现如下图案

出现如上截图,就说明gitlab安装成功了

配置文件设置

1.使用命令vim /etc/gitlab/gitlab.rb打开配置文件

2.找到配置项:external_url并修改访问地址和端口

3.找到配置项:gitlab_workhorse['auth_backend'] = "http://localhost:8989",修改端口

4.找到配置项:unicorn['port'] = 8989,修改其端口

5.使用命令gitlab-ctl reconfigure重启gitlab服务

使用修改后的地址+端口访问,出现如下页面:

到此,出现如上截图页面,则说明配置成功了,就可以使用gitlab了。

gitlab用户操作

1.初始化账号密码

进入到该目录:cd /opt/gitlab/bin,输入命令:sudo gitlab-rails console production

2.查找用户

输入u=User.where(id:1).first 来查找与切换账号(User.all 可以查看所有用户)

3.设置用户密码

输入u.password='hong1234'设置密码为hong1234

通过u.password_confirmation='hong1234' 再次确认密码

通过 u.save!进行保存(切记切记 后面的 !),返回为true表示成功

执行 exit 退出当前设置流程即可

以上就是今天的分享,有错之处,欢迎批评指正。

 

本文仅代表作者观点,系作者@温一壶清酒发表。
欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
文章出处:http://www.cnblogs.com/hong-fithing/

Guess you like

Origin www.cnblogs.com/hong-fithing/p/11073195.html