Jenkins 搭建自动化测试环境

Jenkins 安装

官网下载war

官网下载 Download Jenkins 2.148 for: jenkins.war

安装并启动服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Last login: Sun Oct 28 16:16:56 on ttys002
dyld: Library not loaded: /usr/local/opt/gdbm/lib/libgdbm.4.dylib
Referenced from: /usr/local/bin/zsh
Reason: image not found
zsh: abort
➜ ~ /Users/niuhesm/resouces/Jekins
➜ Jekins ls
jenkins.war
➜ Jekins ll
total 148272
-rw-r--r--@ 1 niuhesm staff 72M 10 28 17:03 jenkins.war
➜ Jekins clear
➜ Jekins ls
jenkins.war
➜ Jekins java -jar jenkins.war
Running from: /Users/niuhesm/resouces/Jekins/jenkins.war
webroot: $user.home/.jenkins
十月 28, 2018 5:10:56 下午 org.eclipse.jetty.util.log.Log initialized
信息: Logging initialized @621ms to org.eclipse.jetty.util.log.JavaUtilLog
十月 28, 2018 5:10:57 下午 winstone.Logger logInternal
信息: Beginning extraction from war file
十月 28, 2018 5:10:58 下午 org.eclipse.jetty.server.handler.ContextHandler setContextPath
警告: Empty contextPath
十月 28, 2018 5:10:58 下午 org.eclipse.jetty.server.Server doStart
信息: jetty-9.4.z-SNAPSHOT; built: 2018-08-30T13:59:14.071Z; git: 27208684755d94a92186989f695db2d7b21ebc51; jvm 1.8.0_121-b13
十月 28, 2018 5:10:59 下午 org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
信息: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
十月 28, 2018 5:10:59 下午 org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
信息: DefaultSessionIdManager workerName=node0
十月 28, 2018 5:10:59 下午 org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
信息: No SessionScavenger set, using defaults
十月 28, 2018 5:10:59 下午 org.eclipse.jetty.server.session.HouseKeeper startScavenging
信息: node0 Scavenging every 660000ms
Jenkins home directory: /Users/niuhesm/.jenkins found at: $user.home/.jenkins
十月 28, 2018 5:11:01 下午 org.eclipse.jetty.server.handler.ContextHandler doStart
信息: Started w.@2187fff7{Jenkins v2.148,/,file:///Users/niuhesm/.jenkins/war/,AVAILABLE}{/Users/niuhesm/.jenkins/war}
十月 28, 2018 5:11:01 下午 org.eclipse.jetty.server.AbstractConnector doStart
信息: Started ServerConnector@660e9100{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
十月 28, 2018 5:11:01 下午 org.eclipse.jetty.server.Server doStart
信息: Started @5588ms
十月 28, 2018 5:11:01 下午 winstone.Logger logInternal
信息: Winstone Servlet Engine v4.0 running: controlPort=disabled
十月 28, 2018 5:11:03 下午 jenkins.InitReactorRunner$1 onAttained
信息: Started initialization
十月 28, 2018 5:11:03 下午 jenkins.InitReactorRunner$1 onAttained
信息: Listed all plugins
十月 28, 2018 5:11:05 下午 jenkins.InitReactorRunner$1 onAttained
信息: Prepared all plugins
十月 28, 2018 5:11:05 下午 jenkins.InitReactorRunner$1 onAttained
信息: Started all plugins
十月 28, 2018 5:11:05 下午 jenkins.InitReactorRunner$1 onAttained
信息: Augmented all extensions
十月 28, 2018 5:11:07 下午 jenkins.InitReactorRunner$1 onAttained
信息: Loaded all jobs
十月 28, 2018 5:11:07 下午 hudson.model.AsyncPeriodicWork$1 run
信息: Started Download metadata
十月 28, 2018 5:11:09 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@315668fb: display name [Root WebApplicationContext]; startup date [Sun Oct 28 17:11:09 CST 2018]; root of context hierarchy
十月 28, 2018 5:11:09 下午 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@315668fb]: org.springframework.beans.factory.support.DefaultListableBeanFactory@2c5f65b3
十月 28, 2018 5:11:09 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@2c5f65b3: defining beans [authenticationManager]; root of factory hierarchy
十月 28, 2018 5:11:09 下午 org.springframework.context.support.AbstractApplicationContext prepareRefresh
信息: Refreshing org.springframework.web.context.support.StaticWebApplicationContext@48bbdcc5: display name [Root WebApplicationContext]; startup date [Sun Oct 28 17:11:09 CST 2018]; root of context hierarchy
十月 28, 2018 5:11:09 下午 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
信息: Bean factory for application context [org.springframework.web.context.support.StaticWebApplicationContext@48bbdcc5]: org.springframework.beans.factory.support.DefaultListableBeanFactory@53866d40
十月 28, 2018 5:11:09 下午 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
信息: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@53866d40: defining beans [filter,legacy]; root of factory hierarchy
十月 28, 2018 5:11:09 下午 jenkins.install.SetupWizard init
信息:

*************************************************************
*************************************************************
*************************************************************

Jenkins initial setup is required. An admin user has been created and a password generated.
Please use the following password to proceed to installation:

cc2e5c2985cc437e8cd33d1ea7e37210

This may also be found at: /Users/niuhesm/.jenkins/secrets/initialAdminPassword

*************************************************************
*************************************************************
*************************************************************

十月 28, 2018 5:12:27 下午 hudson.model.AsyncPeriodicWork$1 run
信息: Finished Download metadata. 80,614 ms
十月 28, 2018 5:14:01 下午 hudson.model.UpdateSite updateData
信息: Obtained the latest update center data file for UpdateSource default
十月 28, 2018 5:14:02 下午 jenkins.InitReactorRunner$1 onAttained
信息: Completed initialization
十月 28, 2018 5:14:02 下午 hudson.UDPBroadcastThread run
信息: Cannot listen to UDP port 33,848, skipping: java.net.SocketException: Can't assign requested address
十月 28, 2018 5:14:02 下午 hudson.WebAppMain$3 run
信息: Jenkins is fully up and running
查看密码登录
1
2
3
4
➜  ~ vim /Users/niuhesm/.jenkins/secrets/initialAdminPassword
➜ ~ cat /Users/niuhesm/.jenkins/secrets/initialAdminPassword
cc2e5c2985cc437e8cd33d1ea7e37210
➜ ~
选择安装方式
1
2
3
4
1. Install suggested plugins
2. Select plugins to install

选择第一种,推荐的安装模式,安装需要一段时间
创建用户

填写相关的用户信息(smniuhe,smniuhe),点击 Save and Continue

Instance Configuration

Jenkins URL: http://localhost:8080/ ,点击 Save and Finish Start using Jenkins

插件安装

1
2
3
系统管理》插件管理》选择available》filter过滤插件
Rebuilder 用于构建插件
safe restart 安全重启插件

基础设置

1
2
3
4
全局安全配置》Authorization》安全矩阵
add user or groups... , 输入smniuhe,授予所有权限
管理用户》添加用户
创建一个 guest 用户,授予所有权限(去除 administer)

应用服务器

linux 系统准备
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1. 确认ip地址
2. 确认登录用户名、密码
3. 确定启动了ssh服务
4. 确定防火墙是否关闭


## 查看ip地址
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.106.154 netmask 255.255.240.0 broadcast 172.19.111.255
ether 00:16:3e:06:03:ef txqueuelen 1000 (Ethernet)
RX packets 7782177 bytes 1405512494 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7414005 bytes 1016904340 (969.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 5404745 bytes 341429566 (325.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5404745 bytes 341429566 (325.6 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 查看 ssh 服务是否启动
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# netstat -anp|grep :22
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1804/sshd
tcp 0 0 172.19.106.154:22 220.175.70.154:30021 ESTABLISHED 31085/sshd: root@pt
tcp 0 36 172.19.106.154:22 117.166.23.61:13830 ESTABLISHED 31827/sshd: root@pt
## 如果没有启动,该命令是启动 ssh 服务
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# service sshd start
Redirecting to /bin/systemctl start sshd.service

## 检查防火墙的状态
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
Unit iptables.service could not be found.
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# firewall-cmd --state
not running
## 停止 firewall
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# systemctl stop firewalld.service
## 静止 firewall 开机启动
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# systemctl disable firewalld.service
安装Java环境
1
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install java
安装Git
1
2
3
4
5
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install git
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# git version
git version 1.8.3.1
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# git config --global user.name "smniuhe"
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# git config --global user.email "smniuhe@163.com"
SSH证书
1
2
3
4
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# ssh-keygen -t rsa -C "smniuhe@163.com"
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# cd ~/.ssh/
[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]# ls
authorized_keys id_rsa id_rsa.pub
Github关联linux服务器
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
##Github上 SSH keys Add key
Title LinuxEnv
Key 如下
[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]# cat id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDR0r/R1UdT9BRr8TsjONLmf8Kj0M6G/6fbGbD7ChHs1EAPFRjxSpJhl0noIKFdQYg9kJ8PpIkj6fIslXHvpYupqrDKGZ1l4xAJt+u1iUQsLEfv7XrarL6I1V3+nWowsAO1CpIdxS41A4lKZ34snt5IG55BVm+Gnq3puD59qrE4iNwfV1zfZRwDdjHI7/x8TY9PdHHSQNEk4GesUF9y3ynUnxMIwRxIui9c5D+iLaw2RgMLb0Y8Zh7F/pQ2uUYkvbA7Fz0N/883201BrWGFbyqn19geZqfvF6enKipa6H0whW6uM1KPkMIur3HTvRKOTdzsvP5jiknGAwufkMCQVsjr smniuhe@163.com

##验证centos是否授信github
[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]# ssh git@github.com
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
RSA key fingerprint is MD5:16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
PTY allocation request failed on channel 0
Hi SmNiuhe! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]#
安装并配置Maven
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
http://maven.apache.org/ -》Download -》Binary zip archive	apache-maven-3.5.4-bin.zip
复制其地址
http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip

[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]# wget http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
--2018-10-28 22:09:35-- http://mirrors.tuna.tsinghua.edu.cn/apache/maven/maven-3/3.5.4/binaries/apache-maven-3.5.4-bin.zip
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9001022 (8.6M) [application/zip]
Saving to: 'apache-maven-3.5.4-bin.zip'

100%[====================================================================================================================================>] 9,001,022 29.3MB/s in 0.3s

2018-10-28 22:09:36 (29.3 MB/s) - 'apache-maven-3.5.4-bin.zip' saved [9001022/9001022]

[root@iZuf6iq8e7ya9v3ix71k0pZ .ssh]# cd ~
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# unzip apache-maven-3.5.4-bin.zip
-bash: unzip: 未找到命令
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# yum install -y unzip zip
[root@iZuf6iq8e7ya9v3ix71k0pZ ~]# vim /etc/profile
## 配置文件的末端添加如下参数,相当于windows下配置环境变量中的path参数
export MAVEN_HOME=/root/apache-maven-3.5.4
export PATH=$MAVEN_HOME/bin:$PATH

## 加载下刚配置的文件
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-maven-3.5.4]# . /etc/profile
## 验证maven配置是否生效
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-maven-3.5.4]# mvn -version
Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-18T02:33:14+08:00)
Maven home: /root/apache-maven-3.5.4
Java version: 1.8.0_111, vendor: Oracle Corporation, runtime: /usr/java/jdk1.8.0_111/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: "linux", version: "3.10.0-514.26.2.el7.x86_64", arch: "amd64", family: "unix"
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-maven-3.5.4]#
安装并配置Tomcat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-9/v9.0.12/bin/apache-tomcat-9.0.12.zip
[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll
total 10284
-rw-r--r-- 1 root root 10520486 Sep 5 06:35 apache-tomcat-9.0.12.zip
drwxr-xr-x 10 root root 4096 Apr 4 2018 tomcat-8081
drwxr-xr-x 9 root root 4096 Apr 4 2018 tomcat-8082
[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# unzip apache-tomcat-9.0.12.zip
[root@iZuf6iq8e7ya9v3ix71k0pZ tomcat]# ll
total 10288
drwxr-xr-x 9 root root 4096 Sep 4 23:15 apache-tomcat-9.0.12
-rw-r--r-- 1 root root 10520486 Sep 5 06:35 apache-tomcat-9.0.12.zip
drwxr-xr-x 10 root root 4096 Apr 4 2018 tomcat-8081
drwxr-xr-x 9 root root 4096 Apr 4 2018 tomcat-8082

## 赋予执行权限
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-tomcat-9.0.12]# chmod a+x -R *
chomd 修改权限的命令
a+x 赋予登录的所有人,可执行权限
-R 表示当前路径和子路径
* 表示所有问题
## 更换端口,8090
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-tomcat-9.0.12]# vim conf/server.xml
## 启动验证Tomcat
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-tomcat-9.0.12]# ps -ef|grep tomcat
root 32153 1 23 22:52 pts/0 00:00:02 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/apache-tomcat-9.0.12/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/apache-tomcat-9.0.12/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.12/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat/apache-tomcat-9.0.12 -Dcatalina.home=/usr/local/tomcat/apache-tomcat-9.0.12 -Djava.io.tmpdir=/usr/local/tomcat/apache-tomcat-9.0.12/temp org.apache.catalina.startup.Bootstrap start
root 32185 31829 0 22:52 pts/0 00:00:00 grep --color=auto tomcat
[root@iZuf6iq8e7ya9v3ix71k0pZ apache-tomcat-9.0.12]# lsof -i:8090
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 32153 root 49u IPv4 3994555 0t0 TCP *:8090 (LISTEN)
## 浏览器验证
http://smniuhe.com:8090/
## 新建节点
Linux注册到 Jenkins 上
新建节点
1
2
3
4
5
6
7
8
系统管理》节点管理》New Node
Node name: TestEnv
选择固定节点
Description:这是一台测试环境的Linux主机
Remote root directory:/root/.jenkins
Launch method:Launch agent agents via SSH
主机:smniuhe.com
Credintials:xxxxx
启动节点,验证
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
点击当前节点,再返回到节点列表,可以查看linux主机的相关信息
## 验证
进入主页》New 任务
Enter an item name:TestTask
选择:构建一个自由风格的软件项目
点击Ok,
选中 `Restrict where this project can be run
Label Expression: TestEnv(表示只能在这个节点上运行)

Build》执行 shell
Command: ifconfig
点击保存

立即构建
点击 Build History>#1
点击 Console Output

## 验证成功 shell 命令生效
由用户 smniuheQm 启动
在远程节点 TestEnv 上构建 在工作空间 /root/.jenkins/workspace/TestTask 中
[TestTask] $ /bin/sh -xe /tmp/jenkins403614120976103060.sh
+ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.106.154 netmask 255.255.240.0 broadcast 172.19.111.255
ether 00:16:3e:06:03:ef txqueuelen 1000 (Ethernet)
RX packets 7834286 bytes 1466452360 (1.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7436834 bytes 1020460157 (973.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1 (Local Loopback)
RX packets 5406822 bytes 341559418 (325.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5406822 bytes 341559418 (325.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Finished: SUCCESS

部署应用介绍与前期准备

1
2
新建一个项目,Push 到 Github 上
复制url: git@github.com:SmNiuhe/springboot-jenkins.git

自动化部署任务开发

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
git 同步最新代码 =》 maven 打包 =》 停止 Tomcat =》 部署应用 =》 启动tomcat =》验证结果

创建Jenkins部署任务
创建Jenkins任务 =》填写Server信息 =》配置git参数 =》填写构建语句,实际部署测试环境

1. 创建任务
2. 填写相关信息
勾选 `Restrict where this project can be run`
`Label Expression` 输入并选择 `TestEnv`
3. 配置git参数
Source Code Management 选择 `Git`
Repository URL `git@github.com:SmNiuhe/springboot-jenkins.git`
Additional Behaviours `add按钮` `Check out to a sub-directory`
Local subdirectory for repo `springboot-jenkins`
Build `add build step` `执行shell`


Command 脚本命令如下 ||
1
2
3
4
5
6
7
8
9
BUILD_ID=DONTKILLME

. /etc/profile

#配置运行参数
export PROJ_PATH=`pwd`
export TOMCAT_APP_PATH=/usr/local/tomcat/apache-tomcat-9.0.12

sh $PROJ_PATH/springboot-jenkins/deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
运行部署任务
执行Jenkins部署任务 =》 确定执行结果成功 =》 打开浏览器访问部署应用程序 =》确定发布结果的正确性
单机立即构建
http://smniuhe.com:8090/ 出现了 {"name":"zhangsan","age":"15"}
nice success !

[root@iZuf6iq8e7ya9v3ix71k0pZ /]# find -name springboot-jenkins
./root/.jenkins/workspace/DeploySpringboot-jenkins/springboot-jenkins
./root/.m2/repository/com/smniuhe/springboot-jenkins
./root/projects/springboot-jenkins
./usr/local/tomcat/apache-tomcat-9.0.12/webapps/ROOT/META-INF/maven/com.smniuhe/springboot-jenkins
[root@iZuf6iq8e7ya9v3ix71k0pZ /]# cd /root/.m2/repository/com/smniuhe/springboot-jenkins
[root@iZuf6iq8e7ya9v3ix71k0pZ springboot-jenkins]# ll
total 8
drwxr-xr-x 2 root root 4096 Oct 29 23:51 1.0
-rw-r--r-- 1 root root 305 Oct 30 00:03 maven-metadata-local.xml
[root@iZuf6iq8e7ya9v3ix71k0pZ springboot-jenkins]# cd 1.0
[root@iZuf6iq8e7ya9v3ix71k0pZ 1.0]# ll
total 15868
-rw-r--r-- 1 root root 198 Oct 30 00:03 _remote.repositories
-rw-r--r-- 1 root root 2393 Oct 30 00:03 springboot-jenkins-1.0.pom
-rw-r--r-- 1 root root 16237933 Oct 30 00:03 springboot-jenkins-1.0.war
[root@iZuf6iq8e7ya9v3ix71k0pZ 1.0]# cd /root/.jenkins/workspace/DeploySpringboot-jenkins/springboot-jenkins
[root@iZuf6iq8e7ya9v3ix71k0pZ springboot-jenkins]# ll
total 32
-rw-r--r-- 1 root root 1026 Oct 29 23:32 deploy.sh
-rwxr-xr-x 1 root root 6468 Oct 29 23:32 mvnw
-rw-r--r-- 1 root root 4994 Oct 29 23:32 mvnw.cmd
-rw-r--r-- 1 root root 2393 Oct 30 00:03 pom.xml
drwxr-xr-x 4 root root 4096 Oct 29 23:32 src
drwxr-xr-x 10 root root 4096 Oct 30 00:03 target
[root@iZuf6iq8e7ya9v3ix71k0pZ springboot-jenkins]#