当前位置:网站首页>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
边栏推荐
- Ambari (VII) --- ambari integrated hue4.2 document (valid for personal test)
- Hash slot of rediscluster cluster cluster implementation principle
- Safety training is the greatest benefit for employees! 2022 induction safety training for new employees
- Jacobian matrix J commonly used in slam
- asp. Net datalist when there are multiple data displays
- MySQL installation and environment variable configuration
- ES6 use of return in arrow function
- Explanation and application of instr() function in Oracle
- es数据导出csv文件
- MySQL single table access method
猜你喜欢
Three step problem of leetcode
Application of XOR. (extract the rightmost 1 in the number, which is often used in interviews)
Online WPS tool
Disposition Flex
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
asp. Net datalist when there are multiple data displays
Redis cerebral fissure
Redis persistence problem and final solution
Redis implements distributed locks
HJ质数因子
随机推荐
Jacobian matrix J commonly used in slam
Configuring multiple instances of MySQL under Linux
kubernetes集群命令行工具kubectl
Cloud native: cloud computing technology is upgraded again to open an era of comprehensive cloud development
2021 programming language ranking summary
What is the lifecycle of automated testing?
Online WPS tool
Trigonometric transformation formula
Safety training is the greatest benefit for employees! 2022 induction safety training for new employees
HJ score ranking
nlp序列完全可以模拟人脑智能
7-1 understand everything
Installing redis on Linux
Is it reliable to open an account by digging money? Is it safe?
Buffer pool in MySQL
A single node obtains the lock lock of the order number
22/02/14 study notes
Kubernetes cluster command line tool kubectl
你了解TCP协议吗(二)?
Porting ucosiii to stm32f429