安裝:
參考官網:https://jenkins.io/doc/pipeline/tour/getting-started/
步驟:
複製程式碼

1.建立賬號
Manage Jenkins -> Configure Global Security
checked (Jenkins’ own user database -> Allow users to sign up)
複製程式碼

2.配置語言環境
參考部落格:https://blog.csdn.net/qq_15807167/article/details/79896131
複製程式碼
使用:
1.新建自由風格專案
複製程式碼

設定分支或環境變數
複製程式碼

設定git原始碼地址
複製程式碼

新增執行指令碼
複製程式碼

如果要build在本地,可設定使用本地工作空間
指定本地空間後,可以不設定ssh程式碼源,之間新增指令碼執行原生程式碼
複製程式碼

如果需要使用者程式碼倉庫,需要配置憑證
複製程式碼

有需要可以設定定時執行
複製程式碼
參考部落格

配置使用者許可權
安裝外掛 Role Strategy Plugin
選擇 Role Based Strategy
複製程式碼
參考部落格

如果配置失敗了,刪除config.xml中的配置資訊
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy"/>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>false</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
讓後重啟Jenkins
複製程式碼
參考部落格
在構建專案時,如果要先構建另外一個依賴專案
先安裝外掛Parameterized Trigger
複製程式碼

讓後在構建配置這裡新增配置(trigger/call builds on other projects)
注意:還可以觸遠端jenkins的專案
配置的一定要在指令碼前
複製程式碼
