新建項目
添加jenkins項目名稱 tomcat01
選擇 構建一個自由風格的軟件項目
源碼管理 填寫源代碼的路徑這裏是用git,所有選擇git選項
4. 構建觸發器
選擇 Poll SCM
日程表 填 * * * * * (表示每分鐘檢測一次git倉庫,如果版本不一樣,則更新)
5. 構建
選擇 Execute shell
填寫構建shell ,把代碼打包成war包
cd /var/jenkins_home/workspace/tomcat01
jar -cvf test01.war index.html
6. 構建後操作(分發,部署)
把打包好的war包發佈到tomcat,併發郵件通知