当前位置:网站首页>Devops Basics: Jenkins deployment and use (I)
Devops Basics: Jenkins deployment and use (I)
2022-06-28 08:00:00 【m0_ fifty-nine million four hundred and thirty thousand one hun】
List of articles
Prepare the environment
Server list
| name | IP Address | Installed software |
|---|---|---|
| Code hosting server | 192.168.74.11 | Gitlab-12.4.2 |
| Continuous integration server | 192.168.74.8 | Jenkins-2.190.3,JDK1.8,Maven3.6.2,Git, SonarQube |
| Application test server | 192.168.74.6 | JDK1.8,Tomcat8.5 |
Another one is needed windows The server configures the basic environment
One 、 stay window Configure the basic environment in
1. build java Environmental Science






To configure java environment variable






It can also be another way 
Check it out 
2. install idea Installation package







Use the patch to activate


This path is the location of your installation path
-javaagent:D:\IntelliJ IDEA 2019.3.1\bin\jetbrains-agent.jar








The results are shown in the figure above , For the time being .
Two 、Gitlab Warehouse , Deploy
1. Gitlab brief introduction
GitLab Is an open source project for warehouse management system , Use Git As a code management tool , And built on this basis web service .
GitLab and GitHub Also belongs to the third party base Git Developed works , Free and open source ( be based on MIT agreement ), And Github similar , You can register users , Submit your code at will , add to SSHKey wait . The difference is ,GitLab Yes, you can deploy to your own server On , The database and other information are in their own hands , Suitable for team internal collaborative development , You can't always put the wisdom within the team On someone else's server ? To put it simply, you can GitLab As a personal version of GitHub.
2. Gitlab install
Change the host name of the server 
- Installation dependent
[[email protected] ~]# yum -y install policycoreutils openssh-server openssh-clients postfix
- start-up ssh service & Set to boot
[[email protected] ~]# systemctl enable sshd && sudo systemctl start sshd

- Set up postfix Boot from boot , And start the ,postfix Support gitlab Sending function
[[email protected] ~]# systemctl enable postfix && systemctl start postfix
- Turn off firewall
[[email protected] ~]# systemctl stop firewalld
[[email protected] ~]# systemctl disable firewalld
[[email protected] ~]# setenforce 0
- download gitlab package , And install the online download installation package :
[[email protected] ~]# wget https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el6/gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm
install :
[[email protected] ~]# rpm -ivh gitlab-ce-12.4.2-ce.0.el6.x86_64.rpm

- modify gitlab To configure
[[email protected] ~]# vim /etc/gitlab/gitlab.rb
Use set nu command
In the 23 That's ok external_url 'http://192.168.74.11:82' # The access address is set to local IP Address
In the 1112 That's ok nginx['listen_port'] = 82 # Monitor port changed to 82, The previous comments need to be cancelled
- Overload configuration and startup gitlab( Need to wait )
[[email protected] ~]# gitlab-ctl reconfigure gitlab-ctl restart

restart
[[email protected] ~]# gitlab-ctl restart

- After successful startup , See the following change manager root Password page , After changing the password , Then log in

3. Gitlab add group 、 Create user 、 Create project
Create group
Use admin root Create group , A group can have multiple project branches , You can add development to a group to set permissions , Different groups are different development projects or service modules of the company , Adding different development to different groups can realize the permission setting of development management


Create user
When creating users , You can choose Regular or Admin type .

After creating users , Change password now

Add users to groups
Select a user group , Conduct Members Members of the management group






Gitlab Users in the group have 5 There are two different permissions :
Guest:You can create issue、 Comment , Can't read or write version LibraryReporter:You can clone code , Cannot submit ,QA、PM You can give this permissionDeveloper:You can clone code 、 Development 、 Submit 、push, Normal development can give this permissionMaintainer:You can create projects 、 add to tag、 Protection branch 、 Add project members 、 Editing project , Core development can give this permissionOwner:You can set project access rights - Visibility Level、 Delete the project 、 Migration project 、 Management team members , The development team leader can give this permission
- Create an item in a user group
Log in to... As the new user you just created Gitlab, Then create a new project in the user group




3、 ... and 、 Upload the source code to Gitlab Warehouse
We need to upload the source code to Gitlab In the project repository of , stay idea in Maven structure web project , And set the environment
1. Enter the newly installed idea






Here let me change the color , White looks a little uncomfortable , I changed it to black 


Next step , You can't visit the website yet ,
2. structure web project









And then it doesn't work , Because of the lack of tomcat
Four 、 install tomcat The server
1. Install package









Here is the key point of this document , Give me permission , Otherwise, it will report an error later
2. To configure IDEA distinguish tomcat




If you do not give the folder permission, an error will be reported 

If installing tomcat No, I didn't -1 If the port of is changed, an error will be reported
Need to go tomcat Of server.xml to glance at ( File path :C:\ProgramFiles\Apache Software Foundation\Tomcat8.5\conf), The default port for general installation is -1, Port cannot be -1,( Values in 1-65535 Any integer between , Generally, it will be greater than 1024 Of , Less than 1024 Is usually occupied by local computer programs ), Change to 8000 Just go .


3. Turn on version control


Prompt to download 
5、 ... and 、 install git
1. Start installation




From here on, just default to the next step 












Exit and reopen idea
2. First Add To cache




3 Pushed to the Gitlab In the project Repository








The code here is not submitted to gitlab Up here , Only submitted to the local 





Refresh gitlab project 






Submit successfully


边栏推荐
- asp. Net datalist when there are multiple data displays
- ZYNQ_ IIC read / write m24m01 record board status
- 7-1 understand everything
- Ice - resources
- 云原生:云计算技术再次升级 开启全面云开发时代
- Host is not allowed to connect to this MySQL server
- Study notes 22/1/19 and 22/1/20
- 异或的应用。(提取出数字中最右侧的1,面试中经常用的到)
- Ambari (V) ---ambari integrated Azkaban (valid for personal test)
- 你了解TCP协议吗(一)?
猜你喜欢
随机推荐
SQL analysis (query interception analysis for SQL optimization)
Airflow2.x distributed deployment DAG execution failure log cannot be obtained normally
Section 8: DMA of zynq
HJ21 简单密码
22/02/14 study notes
Sword finger offer|: linked list (simple)
Update pip to the latest version
Localization SoC development plan
Porting ucosiii to stm32f429
LeetCode之三步问题
kubernetes集群命令行工具kubectl
HJ整数与IP地址间的转换
Static resource compression reduces bandwidth pressure and increases access speed
Co process, asyncio, asynchronous programming
SOC serial port configuration
同花顺注册开户靠谱吗?安全吗?
flex布局
ACM notes
Eslint 语法监测关闭
Sentinel mechanism of redis cluster







![[JS] - [DFS, BFS application] - learning notes](/img/77/6f8d4ebe1d0b3ba036aea9358de793.png)




