Jenkins——實際項目設置

【環境】maven、git
1、新建項目
【General】

Paste_Image.png

【源碼管理】

Paste_Image.png

【構建觸發器】

Paste_Image.png

【構建環境】

Paste_Image.png

【構建】

Paste_Image.png

Goals
clean install -U -P test findbugs:findbugs checkstyle:checkstyle
說明:-U 強制更新maven庫中的依賴包,nexus默認是當天更新,第二天才能生效調用。
-P test :調用pom配置中的test環境參數
findbugs:findbugs checkstyle:checkstyle :執行靜態檢查
【Execute Shell】

Paste_Image.png
echo "項目名稱:" $JOB_NAME >>version.txt
echo "git版本號:" $GIT_COMMIT >>version.txt
echo "構建編號:" $BUILD_NUMBER >>version.txt
jar uvf target/test1*.war version.txt
scp -r ~/.jenkins/workspace/projectname/target/*.war  root@192.168.1.xx1:/home/yuanfang/totest/eid_forpolice/test1.war
scp -r ~/.jenkins/workspace/projectname/target/*.war  root@192.168.1.xx2:/usr/local/tomcat-test-8081/webapps/test1.war
ssh -tt 192.168.1.xx2 "/opt/restart.sh"

【構建后操作】

Paste_Image.png

【Editable Email Notifaction】

Paste_Image.png
Paste_Image.png
Paste_Image.png
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容