持續集成之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 ~]#
- 1
- 2
- 3
- 4
- 5
- 6
啟動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 ~]#
- 1
- 2
- 3
plugin
與Redmine的集成也是通過插件來做的,需要安裝Redmine Plugin插件,目前版本是0.20,通過使用這個插件能夠使得redmine更容易地被集成近來。另外redmine也支持插件,如果將jenkins集成到redmine裏面的話,那就是另外一個插件了。Jenkins中的Redmine插件的詳細說明如下圖所示
安裝
可以使用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 ~]#
- 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
插件安裝確認
重新啟動後確認此插件已經安裝完畢
設定內容
系統管理 -> 系統設置處的Redmine相關內容則為所需設定的內容
設定項目 | 設定方法 | 設定內容 |
---|---|---|
redmine連接名稱 | Redmine -> Name | Redmine連接的名稱 |
redmine的URL | Redmine ->Base url | 可以訪問的Redmine的URL |
版本 | Redmine -> Version number | 版本號 |
詳細設定信息如下:
版本號在redmine的如下頁面可以進行確認
註意事項
redmine處需要打開如下設置( Administration -> Settings -> API)(選中:Enable REST web service):
總結
Jenkins與redmine設定需要下載並安裝redmine插件,設定之後同時需要打開redmine側REST Web Service方可。
再分享一下我老師大神的人工智能教程吧。零基礎!通俗易懂!風趣幽默!還帶黃段子!希望你也加入到我們人工智能的隊伍中來!https://blog.csdn.net/jiangjunshow
持續集成之jenkins實踐教程 基礎篇 4 集成redmine