這一篇,我們來說一下Jenkins的構建觸發器,除了手動運行Job進行構建外,默認Jenkins提供了5種方式的觸發構建,maven項目多一種,可以讓我們通過別的方式觸發來實現Job的自動構建。
這裏我將一一的進行詳細說明,主要包括如下幾種觸發方式,其中github和gitlab的觸發這裏只講gitlab,因爲國內大多公司都是使用gitlab作爲代碼倉庫,較少會用github進行開發。
這裏具體詳細說明的觸發方式如下:
- Build whenever a SNAPSHOT dependency is built
- Trigger builds remotely (e.g., from scripts)
- Build after other projects are built
- Build periodically
- Build when a change is pushed to GitLab. GitLab webhook URL: http://jenkins.example.com/project/test
- Poll SCM
由於觸發方式較多,此文章可能會較長,具體的內容,請查看我的個人博客: