Jenkins 搭建

下载jenkins

http://jenkins-ci.org/content/thank-you-downloading-os-x-installer

会蹦出让填写密码,修改config配置文件

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
<?xml version='1.0' encoding='UTF-8'?>
<user>
<fullName>admin</fullName>
<properties>
<jenkins.security.ApiTokenProperty>
<apiToken>DwHCl6oiyOuxTG5HQBdX/f5qYXxPlu5w3GmRSgUWgcOhj7bX6gs2dJUwFOC/gN6d</apiToken>
</jenkins.security.ApiTokenProperty>
<hudson.model.MyViewsProperty>
<views>
<hudson.model.AllView>
<owner class="hudson.model.MyViewsProperty" reference="../../.."/>
<name>All</name>
<filterExecutors>false</filterExecutors>
<filterQueue>false</filterQueue>
<properties class="hudson.model.View$PropertyList"/>
</hudson.model.AllView>
</views>
</hudson.model.MyViewsProperty>
<hudson.model.PaneStatusProperties>
<collapsed/>
</hudson.model.PaneStatusProperties>
<hudson.search.UserSearchProperty>
<insensitiveSearch>false</insensitiveSearch>
</hudson.search.UserSearchProperty>
<hudson.security.HudsonPrivateSecurityRealm_-Details>
<passwordHash>#jbcrypt:$2a$10$yMAaaf3L.VtUmAzhGSMaXug8P/BJ.k/F1wO7GwQIojMp.E.IdQ6BO</passwordHash>
</hudson.security.HudsonPrivateSecurityRealm_-Details>
</properties>
</user>

如果要修改端口,比如7070,可在第8步重启jenkins前执行以下命令修改端口参数:

1
2
3
4
5
sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 7070  
然后重启jenkins:
sudo launchctl unload -w /Library/LaunchDaemons/org.jenkins-ci.plist
sudo launchctl load -w /Library/LaunchDaemons/org.jenkins-ci.plist
到此,可以访问了:http://localhost:7070