我们通过命令查看一下Jenkins安装后的文件和目录:

(base) [root@Alex ~]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins

1、主配置文件

/etc/sysconfig/jenkins是Jenkins的主配置文件:我们在这里主要配置Jenkins的工作目录、启动用户、启动端口。

Jenkins 程序目录_xml

Jenkins 程序目录_ico_02

Jenkins 程序目录_xml_03

2、主目录:

/var/lib/jenkins:Jenkins配置的主工作目录

(base) [root@Alex ~]# ll /var/lib/jenkins/
total 64
-rw-r--r-- 1 jenkins jenkins 1640 Apr 27 08:51 config.xml
-rw-r--r-- 1 jenkins jenkins 156 Apr 27 08:51 hudson.model.UpdateCenter.xml
-rw------- 1 jenkins jenkins 1712 Apr 26 19:29 identity.key.enc
-rw-r--r-- 1 jenkins jenkins 7 Apr 26 19:29 jenkins.install.UpgradeWizard.state
-rw-r--r-- 1 jenkins jenkins 171 Apr 26 19:29 jenkins.telemetry.Correlator.xml
drwxr-xr-x 2 jenkins jenkins 4096 Apr 26 19:29 jobs
drwxr-xr-x 3 jenkins jenkins 4096 Apr 26 19:29 logs
-rw-r--r-- 1 jenkins jenkins 907 Apr 27 08:51 nodeMonitors.xml
drwxr-xr-x 2 jenkins jenkins 4096 Apr 26 19:29 nodes
drwxr-xr-x 2 jenkins jenkins 4096 Apr 26 19:29 plugins
-rw------- 1 jenkins jenkins 129 Apr 26 21:41 queue.xml.bak
-rw-r--r-- 1 jenkins jenkins 64 Apr 26 19:29 secret.key
-rw-r--r-- 1 jenkins jenkins 0 Apr 26 19:29 secret.key.not-so-secret
drwx------ 4 jenkins jenkins 4096 Apr 26 19:29 secrets
drwxr-xr-x 2 jenkins jenkins 4096 Apr 26 19:32 updates
drwxr-xr-x 2 jenkins jenkins 4096 Apr 26 19:29 userContent
drwxr-xr-x 3 jenkins jenkins 4096 Apr 26 19:29 users

其中主要的目录为

jobs目录:存放jobs的配置及每次构建的结果;

plugins目录:Jenkins插件目录,存放我们已经安装的插件;worksspace:工作区目录。

3、程序目录

/var/cache/Jenkins Jenkins程序文件目录

(base) [root@Alex ~]# ll /var/cache/jenkins/war/
total 3192
drwxr-xr-x 3 jenkins jenkins 4096 Apr 27 08:50 bootstrap
-rw-r--r-- 1 jenkins jenkins 1946 Apr 27 08:50 ColorFormatter.class
drwxr-xr-x 5 jenkins jenkins 4096 Apr 27 08:50 css
-rw-r--r-- 1 jenkins jenkins 1544 Apr 27 08:50 dc-license.txt
drwxr-xr-x 2 jenkins jenkins 4096 Apr 27 08:50 executable
-rw-r--r-- 1 jenkins jenkins 17542 Apr 27 08:50 favicon.ico
drwxr-xr-x 12 jenkins jenkins 4096 Apr 27 08:50 help
drwxr-xr-x 7 jenkins jenkins 4096 Apr 27 08:50 images
-rw-r--r-- 1 jenkins jenkins 1674 Apr 27 08:50 JNLPMain.class
drwxr-xr-x 3 jenkins jenkins 4096 Apr 27 08:50 jsbundles
-rw-r--r-- 1 jenkins jenkins 862 Apr 27 08:50 LogFileOutputStream$1.class
-rw-r--r-- 1 jenkins jenkins 636 Apr 27 08:50 LogFileOutputStream$2.class
-rw-r--r-- 1 jenkins jenkins 2240 Apr 27 08:50 LogFileOutputStream.class
-rw-r--r-- 1 jenkins jenkins 20730 Apr 27 08:50 Main.class
-rw-r--r-- 1 jenkins jenkins 1048 Apr 27 08:50 MainDialog$1$1.class
-rw-r--r-- 1 jenkins jenkins 1067 Apr 27 08:50 MainDialog$1.class
-rw-r--r-- 1 jenkins jenkins 2633 Apr 27 08:50 MainDialog.class
-rw-r--r-- 1 jenkins jenkins 512 Apr 27 08:50 Main$FileAndDescription.class
drwxr-xr-x 3 jenkins jenkins 4096 Apr 27 08:50 META-INF
-rw-r--r-- 1 jenkins jenkins 71 Apr 27 08:50 robots.txt
drwxr-xr-x 3 jenkins jenkins 4096 Apr 27 08:50 scripts
drwxr-xr-x 7 jenkins jenkins 4096 Apr 27 08:50 WEB-INF
-rw-r--r-- 1 jenkins jenkins 3140849 Apr 27 08:50 winstone.jar

4、其他文件

/var/log/Jenkins Jenkins日志文件目录

/etc/init.d/Jenkins Jenkins启动文件