持续集成之jenkins实践教程:基础篇(4): 集成redmine

这里写图片描述
作为持续集成的利器Jenkins已经得到了广泛地应用,仅仅作为一个工具,Jenkins已然了了自己的生态圈,支持其的plugin更是超过1300+。在实际中如何使用以及如何更好地使用jenkins,一直是大家在实践并讨论的。本系列文章将会从如何使用jenkins方面对一些细节进行总结和整理,这篇文章将会介绍如何在Jenkins中实现与redmine的集成

事前准备

只要有jenkins即可,没有的可以使用Jenkins官方的镜像或者安装包,或者使用Easypack中封装的基本一致的Jenkins。

docker pull镜像

[root@liumiaocn ~]# docker pull liumiaocn/jenkins
Using default tag: latest
latest: Pulling from liumiaocn/jenkins
Digest: sha256:87c954f71bc3ce1ba5d001bfbae501f9965368c16f0111ef951350376c2f6832
Status: Image is up to date for liumiaocn/jenkins:latest
[root@liumiaocn ~]#

启动Jenkins镜像
docker run -d -p 8090:8080 -p 50000:50000 –name jenkins liumiaocn/jenkins

[root@liumiaocn ~]# docker run -d -p 8090:8080 -p 50000:50000 --name jenkins liumiaocn/jenkins
63dc2d52de03074858a6b61db4955345a66cfd436c5a47384924e9e3f8177778
[root@liumiaocn ~]#

plugin

与Redmine的集成也是通过插件来做的,需要安装Redmine Plugin插件,目前版本是0.20,通过使用这个插件能够使得redmine更容易地被集成近来。另外redmine也支持插件,如果将jenkins集成到redmine里面的话,那就是另外一个插件了。Jenkins中的Redmine插件的详细说明如下图所示
持续集成之jenkins实践教程:基础篇(4): 集成redmine_第1张图片

安装

可以使用jenkins的插件管理页面进行安装,也可以使用其id(redmine)在镜像中进行安装并重启镜像即可。

[root@liumiaocn ~]# docker exec -it jenkins sh
/ $ install-plugins.sh redmine
Creating initial locks...
Analyzing war...
Downloading plugins...
Downloading plugin: redmine from https://updates.jenkins.io/download/plugins/redmine/latest/redmine.hpi
 > redmine depends on subversion:2.0.1
Downloading plugin: subversion from https://updates.jenkins.io/download/plugins/subversion/latest/subversion.hpi
 > subversion depends on workflow-scm-step:1.14.2,credentials:2.1.4,mapdb-api:1.0.1.0,scm-api:2.0.8,ssh-credentials:1.6.1
Downloading plugin: workflow-scm-step from https://updates.jenkins.io/download/plugins/workflow-scm-step/latest/workflow-scm-step.hpi
Downloading plugin: credentials from https://updates.jenkins.io/download/plugins/credentials/latest/credentials.hpi
Downloading plugin: mapdb-api from https://updates.jenkins.io/download/plugins/mapdb-api/latest/mapdb-api.hpi
Downloading plugin: scm-api from https://updates.jenkins.io/download/plugins/scm-api/latest/scm-api.hpi
Downloading plugin: ssh-credentials from https://updates.jenkins.io/download/plugins/ssh-credentials/latest/ssh-credentials.hpi
 > workflow-scm-step depends on workflow-step-api:2.9
Downloading plugin: workflow-step-api from https://updates.jenkins.io/download/plugins/workflow-step-api/latest/workflow-step-api.hpi
 > credentials depends on structs:1.7
Downloading plugin: structs from https://updates.jenkins.io/download/plugins/structs/latest/structs.hpi
 > ssh-credentials depends on credentials:2.1.0
 > workflow-step-api depends on structs:1.5

WAR bundled plugins:


Installed plugins:
credentials:2.1.14
display-url-api:2.0
git-client:2.4.6
git:3.3.1
gitlab-plugin:1.4.6
jquery:1.11.2-0
junit:1.20
mailer:1.20
mapdb-api:1.0.9.0
matrix-project:1.11
redmine:0.20
scm-api:2.1.1
script-security:1.29
sonar:2.6.1
ssh-credentials:1.13
structs:1.9
subversion:2.8
workflow-scm-step:2.6
workflow-step-api:2.12
Cleaning up locks
/ $ exit
[root@liumiaocn ~]# docker restart jenkins
jenkins
[root@liumiaocn ~]# 

插件安装确认

重新启动后确认此插件已经安装完毕
持续集成之jenkins实践教程:基础篇(4): 集成redmine_第2张图片

设定内容

系统管理 -> 系统设置处的Redmine相关内容则为所需设定的内容

设定项目 设定方法 设定内容
redmine连接名称 Redmine -> Name Redmine连接的名称
redmine的URL Redmine ->Base url 可以访问的Redmine的URL
版本 Redmine -> Version number 版本号

详细设定信息如下:

持续集成之jenkins实践教程:基础篇(4): 集成redmine_第3张图片

版本号在redmine的如下页面可以进行确认
持续集成之jenkins实践教程:基础篇(4): 集成redmine_第4张图片

注意事项

redmine处需要打开如下设置( Administration -> Settings -> API)(选中:Enable REST web service):
持续集成之jenkins实践教程:基础篇(4): 集成redmine_第5张图片

总结

Jenkins与redmine设定需要下载并安装redmine插件,设定之后同时需要打开redmine侧REST Web Service方可。

你可能感兴趣的:(工具,#,自动化工具,#,持续构建)