Jenkins插件管理篇
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.部署Jenkins并查看插件安装目录
1>.部署Jenkins
博主推荐阅读: https://www.cnblogs.com/yinzhengjie2020/p/12549297.html
2>.查看Jenkins的插件目录
[root@jenkins210.yinzhengjie.org.cn ~]# ls -l /var/lib/jenkins/plugins/ total 65748 drwxr-xr-x 7 root root 124 Mar 23 22:18 ace-editor -rw-r--r-- 1 root root 4279042 Mar 23 22:18 ace-editor.jpi drwxr-xr-x 4 root root 56 Mar 23 22:38 apache-httpcomponents-client-4-api -rw-r--r-- 1 root root 1761975 Mar 23 22:38 apache-httpcomponents-client-4-api.jpi drwxr-xr-x 4 root root 56 Mar 23 22:53 authentication-tokens -rw-r--r-- 1 root root 14638 Mar 23 22:53 authentication-tokens.jpi drwxr-xr-x 4 root root 56 Mar 24 01:09 bouncycastle-api -rw-r--r-- 1 root root 3387826 Mar 23 20:11 bouncycastle-api.bak -rw-r--r-- 1 root root 4885133 Mar 24 00:57 bouncycastle-api.jpi drwxr-xr-x 5 root root 70 Mar 23 22:52 branch-api -rw-r--r-- 1 root root 308984 Mar 23 22:52 branch-api.jpi drwxr-xr-x 5 root root 70 Mar 23 22:33 cloudbees-folder -rw-r--r-- 1 root root 219839 Mar 23 22:33 cloudbees-folder.jpi drwxr-xr-x 4 root root 56 Mar 23 21:49 command-launcher -rw-r--r-- 1 root root 38820 Mar 23 21:49 command-launcher.jpi drwxr-xr-x 6 root root 82 Mar 23 22:24 credentials drwxr-xr-x 4 root root 56 Mar 23 22:25 credentials-binding -rw-r--r-- 1 root root 80359 Mar 23 22:25 credentials-binding.jpi -rw-r--r-- 1 root root 971546 Mar 23 22:24 credentials.jpi drwxr-xr-x 4 root root 56 Mar 23 21:49 display-url-api -rw-r--r-- 1 root root 27121 Mar 23 21:49 display-url-api.jpi drwxr-xr-x 5 root root 70 Mar 23 22:53 docker-commons -rw-r--r-- 1 root root 91018 Mar 23 22:53 docker-commons.jpi drwxr-xr-x 4 root root 56 Mar 24 00:33 docker-workflow -rw-r--r-- 1 root root 377402 Mar 24 00:33 docker-workflow.jpi drwxr-xr-x 4 root root 56 Mar 23 23:07 durable-task -rw-r--r-- 1 root root 5286837 Mar 23 23:07 durable-task.jpi drwxr-xr-x 7 root root 97 Mar 23 22:00 email-ext -rw-r--r-- 1 root root 796304 Mar 23 22:00 email-ext.jpi drwxr-xr-x 5 root root 176 Mar 24 00:26 git -rw-r--r-- 1 root root 1435921 Mar 23 23:34 git.bak drwxr-xr-x 4 root root 56 Mar 24 00:23 git-client -rw-r--r-- 1 root root 8508250 Mar 24 00:23 git-client.jpi drwxr-xr-x 7 root root 106 Mar 24 00:29 github drwxr-xr-x 4 root root 56 Mar 23 23:15 github-api -rw-r--r-- 1 root root 1219480 Mar 23 23:15 github-api.jpi -rw-r--r-- 1 root root 2124964 Mar 23 23:24 github.bak drwxr-xr-x 5 root root 98 Mar 24 00:46 github-branch-source -rw-r--r-- 1 root root 274638 Mar 23 23:25 github-branch-source.bak -rw-r--r-- 1 root root 274638 Mar 24 00:46 github-branch-source.jpi -rw-r--r-- 1 root root 2124964 Mar 24 00:29 github.jpi -rw-r--r-- 1 root root 1435921 Mar 24 00:26 git.jpi drwxr-xr-x 5 root root 70 Mar 24 00:29 git-server -rw-r--r-- 1 root root 30408 Mar 23 22:48 git-server.bak -rw-r--r-- 1 root root 30408 Mar 24 00:29 git-server.jpi drwxr-xr-x 5 root root 169 Mar 23 23:26 gradle -rw-r--r-- 1 root root 58363 Mar 23 23:26 gradle.jpi drwxr-xr-x 5 root root 73 Mar 23 22:24 handlebars -rw-r--r-- 1 root root 67784 Mar 23 22:24 handlebars.jpi drwxr-xr-x 4 root root 56 Mar 23 22:07 jackson2-api -rw-r--r-- 1 root root 1972676 Mar 23 22:07 jackson2-api.jpi drwxr-xr-x 4 root root 56 Mar 23 21:42 jdk-tool -rw-r--r-- 1 root root 69922 Mar 23 21:42 jdk-tool.jpi drwxr-xr-x 5 root root 73 Mar 23 22:02 jquery-detached -rw-r--r-- 1 root root 211945 Mar 23 22:02 jquery-detached.jpi drwxr-xr-x 4 root root 56 Mar 23 22:39 jsch -rw-r--r-- 1 root root 279724 Mar 23 22:39 jsch.jpi drwxr-xr-x 4 root root 56 Mar 23 21:47 junit -rw-r--r-- 1 root root 361632 Mar 23 21:47 junit.jpi drwxr-xr-x 4 root root 56 Mar 23 23:54 ldap -rw-r--r-- 1 root root 130445 Mar 23 23:54 ldap.jpi drwxr-xr-x 4 root root 56 Mar 23 22:00 localization-support -rw-r--r-- 1 root root 23848 Mar 23 22:00 localization-support.jpi drwxr-xr-x 5 root root 70 Mar 23 22:01 localization-zh-cn -rw-r--r-- 1 root root 542952 Mar 23 22:01 localization-zh-cn.jpi drwxr-xr-x 5 root root 67 Mar 23 23:13 lockable-resources -rw-r--r-- 1 root root 74635 Mar 23 23:13 lockable-resources.jpi drwxr-xr-x 4 root root 56 Mar 23 21:49 mailer -rw-r--r-- 1 root root 126236 Mar 23 21:49 mailer.jpi drwxr-xr-x 4 root root 56 Mar 23 23:35 mapdb-api -rw-r--r-- 1 root root 396306 Mar 23 23:35 mapdb-api.jpi drwxr-xr-x 5 root root 70 Mar 23 23:25 matrix-auth -rw-r--r-- 1 root root 128779 Mar 23 23:25 matrix-auth.jpi drwxr-xr-x 6 root root 82 Mar 23 21:57 matrix-project -rw-r--r-- 1 root root 230120 Mar 23 21:57 matrix-project.jpi drwxr-xr-x 5 root root 73 Mar 23 22:25 momentjs -rw-r--r-- 1 root root 37051 Mar 23 22:25 momentjs.jpi drwxr-xr-x 4 root root 56 Mar 23 23:30 pam-auth -rw-r--r-- 1 root root 1504184 Mar 23 23:30 pam-auth.jpi drwxr-xr-x 4 root root 56 Mar 23 22:25 pipeline-build-step -rw-r--r-- 1 root root 34943 Mar 23 22:25 pipeline-build-step.jpi drwxr-xr-x 4 root root 56 Mar 24 00:38 pipeline-github-lib -rw-r--r-- 1 root root 8479 Mar 23 23:25 pipeline-github-lib.bak -rw-r--r-- 1 root root 8479 Mar 24 00:38 pipeline-github-lib.jpi drwxr-xr-x 4 root root 56 Mar 23 22:24 pipeline-graph-analysis -rw-r--r-- 1 root root 20613 Mar 23 22:24 pipeline-graph-analysis.jpi drwxr-xr-x 4 root root 56 Mar 23 22:24 pipeline-input-step -rw-r--r-- 1 root root 30501 Mar 23 22:24 pipeline-input-step.jpi drwxr-xr-x 4 root root 56 Mar 23 22:01 pipeline-milestone-step -rw-r--r-- 1 root root 18994 Mar 23 22:01 pipeline-milestone-step.jpi drwxr-xr-x 4 root root 56 Mar 23 22:32 pipeline-model-api -rw-r--r-- 1 root root 2437725 Mar 23 22:32 pipeline-model-api.jpi drwxr-xr-x 4 root root 56 Mar 23 23:08 pipeline-model-declarative-agent -rw-r--r-- 1 root root 6319 Mar 23 23:08 pipeline-model-declarative-agent.jpi drwxr-xr-x 5 root root 70 Mar 24 00:37 pipeline-model-definition -rw-r--r-- 1 root root 1486848 Mar 23 23:13 pipeline-model-definition.bak -rw-r--r-- 1 root root 1486848 Mar 24 00:37 pipeline-model-definition.jpi drwxr-xr-x 4 root root 56 Mar 23 22:32 pipeline-model-extensions -rw-r--r-- 1 root root 38943 Mar 23 22:32 pipeline-model-extensions.jpi drwxr-xr-x 4 root root 56 Mar 23 22:24 pipeline-rest-api -rw-r--r-- 1 root root 64609 Mar 23 22:24 pipeline-rest-api.jpi drwxr-xr-x 4 root root 56 Mar 23 22:24 pipeline-stage-step -rw-r--r-- 1 root root 19872 Mar 23 22:24 pipeline-stage-step.jpi drwxr-xr-x 4 root root 56 Mar 23 23:08 pipeline-stage-tags-metadata -rw-r--r-- 1 root root 10609 Mar 23 23:08 pipeline-stage-tags-metadata.jpi drwxr-xr-x 7 root root 100 Mar 23 22:25 pipeline-stage-view -rw-r--r-- 1 root root 201293 Mar 23 22:25 pipeline-stage-view.jpi drwxr-xr-x 4 root root 56 Mar 23 22:25 plain-credentials -rw-r--r-- 1 root root 17509 Mar 23 22:25 plain-credentials.jpi drwxr-xr-x 4 root root 56 Mar 23 21:46 scm-api -rw-r--r-- 1 root root 218705 Mar 23 21:46 scm-api.jpi drwxr-xr-x 4 root root 56 Mar 23 21:45 script-security -rw-r--r-- 1 root root 1012545 Mar 23 21:45 script-security.jpi drwxr-xr-x 5 root root 70 Mar 23 22:25 ssh-credentials -rw-r--r-- 1 root root 65885 Mar 23 22:25 ssh-credentials.jpi drwxr-xr-x 4 root root 56 Mar 23 23:25 ssh-slaves -rw-r--r-- 1 root root 176979 Mar 23 23:25 ssh-slaves.jpi drwxr-xr-x 4 root root 56 Mar 23 21:45 structs -rw-r--r-- 1 root root 44501 Mar 23 21:45 structs.jpi drwxr-xr-x 4 root root 275 Mar 23 23:54 subversion -rw-r--r-- 1 root root 7350744 Mar 23 23:54 subversion.jpi drwxr-xr-x 4 root root 56 Mar 23 21:49 token-macro -rw-r--r-- 1 root root 655887 Mar 23 21:49 token-macro.jpi drwxr-xr-x 4 root root 56 Mar 23 21:42 trilead-api -rw-r--r-- 1 root root 391658 Mar 23 21:42 trilead-api.jpi drwxr-xr-x 4 root root 56 Mar 24 00:37 workflow-aggregator -rw-r--r-- 1 root root 8655 Mar 23 23:13 workflow-aggregator.bak -rw-r--r-- 1 root root 8655 Mar 24 00:37 workflow-aggregator.jpi drwxr-xr-x 4 root root 56 Mar 23 21:46 workflow-api -rw-r--r-- 1 root root 155890 Mar 23 21:46 workflow-api.jpi drwxr-xr-x 4 root root 56 Mar 23 23:07 workflow-basic-steps -rw-r--r-- 1 root root 147305 Mar 23 23:07 workflow-basic-steps.jpi drwxr-xr-x 6 root root 86 Mar 23 22:21 workflow-cps drwxr-xr-x 4 root root 56 Mar 24 00:32 workflow-cps-global-lib -rw-r--r-- 1 root root 1711383 Mar 23 22:52 workflow-cps-global-lib.bak -rw-r--r-- 1 root root 1711383 Mar 24 00:32 workflow-cps-global-lib.jpi -rw-r--r-- 1 root root 603646 Mar 23 22:21 workflow-cps.jpi drwxr-xr-x 4 root root 56 Mar 23 23:07 workflow-durable-task-step -rw-r--r-- 1 root root 99500 Mar 23 23:07 workflow-durable-task-step.jpi drwxr-xr-x 5 root root 70 Mar 23 22:24 workflow-job -rw-r--r-- 1 root root 138184 Mar 23 22:24 workflow-job.jpi drwxr-xr-x 5 root root 70 Mar 23 22:53 workflow-multibranch -rw-r--r-- 1 root root 85719 Mar 23 22:53 workflow-multibranch.jpi drwxr-xr-x 4 root root 56 Mar 23 22:18 workflow-scm-step -rw-r--r-- 1 root root 15119 Mar 23 22:18 workflow-scm-step.jpi drwxr-xr-x 4 root root 56 Mar 23 21:45 workflow-step-api -rw-r--r-- 1 root root 75642 Mar 23 21:45 workflow-step-api.jpi drwxr-xr-x 5 root root 70 Mar 23 22:19 workflow-support -rw-r--r-- 1 root root 380755 Mar 23 22:19 workflow-support.jpi [root@jenkins210.yinzhengjie.org.cn ~]#
3>.官方提供的Jenkins插件下载地址
博主推荐阅读: http://updates.jenkins-ci.org/download/plugins/
4>.官方提供的下载并不友好(可能下载2个多小时还以失败告终....)
5>.对Jenkins插件下载进行提速(博主亲测好使,强烈推荐使用,该步骤可以帮你节省不少时间哟~上面2个小时搞不定的,做了该步骤2分钟就搞定啦~)
[root@jenkins210.yinzhengjie.org.cn ~]# cd /var/lib/jenkins/updates/ #进入到存放Jenkins的updates目录 [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# cp default.json default.json-`date +%F` #修改前记得备份文件哟~ [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# ll total 3980 -rw-r--r-- 1 root root 1874616 Mar 23 20:44 default.json -rw-r--r-- 1 root root 1874616 Mar 24 06:09 default.json-2020-03-24 -rw-r--r-- 1 root root 29398 Mar 23 23:54 hudson.plugins.gradle.GradleInstaller -rw-r--r-- 1 root root 5350 Mar 23 20:12 hudson.tasks.Maven.MavenInstaller -rw-r--r-- 1 root root 279724 Mar 23 23:54 hudson.tools.JDKInstaller [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# sed -i 's/http://updates.jenkins-ci.org/download/https://mirrors.tuna.tsinghua.edu.cn/jenkins/g' default.json #修改下载源 [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# sed -i 's/http://www.google.com/https://www.baidu.com/g' default.json #修改国内的检测地址 [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]# systemctl restart jenkins #重启服务使得配置文件生效 [root@jenkins210.yinzhengjie.org.cn /var/lib/jenkins/updates]#
二.安装gitlab插件
1>.如下图所示,以管理员身份登录,点击"系统管理"
2>.点击"插件管理"
3>.查看已安装插件信息
4>.如下图所示,过滤需要安装的插件后,点击"直接安装"
5>.等待组件安装插件过程
6>.插件安装完成可以点击上图的"安装完成后重启Jenkins(空闲时)",当然我们也可以手动重启哟~
[root@jenkins210.yinzhengjie.org.cn ~]# systemctl restart jenkins
7>.如下图所示,在"已安装"的插件中搜索查gitlab插件
三.安装Blue Ocean插件
1>.以管理员身份登录,点击"系统管理"
2>.点击"插件管理"
3>.勾选"Blue Ocean"插件并点击"直接安装"
4>.等待组件安装完成
5>.如下图所示,点击"安装完成时重启Jenkins(空闲时)"
6>.按照上图的操作会进行网页重启,如下图所示(当然,你也可以手动重启Jenkins服务哟~)
7>.重启完成后,会自动进入到之前的安装页面
8>.查看已安装插件是否存在咱们刚刚安装的"Blue Ocean"插件,如下图所示
9>.如下图所示,进入主页面,我们也可以看到"Blue Ocean"插件安装成功
10>.进入到"Blue Ocean"插件的页面