Jenkins
Jenkins is a CI tool.
Install
brew update brew install jenkins
Run
brew services start jenkins
在瀏覽器中訪問http://localhost:8080/,根據(jù)提示進(jìn)行操作,直至出現(xiàn)Jenkins的操作界面
Creating your first Pipeline
- 在左上角點擊New Item新建pipeline,輸入一個名字,選擇Pipeline,點擊OK
- 在Pipeline中設(shè)置Definition為
Pipeline script from SCM,設(shè)置SCM為Git,并添加倉庫地址 - 創(chuàng)建Jenkinsfile文件,內(nèi)容示例
// Jenkinsfile (Declarative Pipeline)
pipeline {
agent any
stages {
stage('Stage 1') {
steps {
echo 'Hello world!'
}
}
}
}
- 保存并提交,在Jenkins中點擊
build now - 在
build history中選擇并在Console Output中查看控制臺輸出
Add a webhook to the pipeline
Triggering a Jenkins build on push using GitHub webhooks
IOS
修改Jenkinsfile文件中的內(nèi)容來build iOS項目
pipeline {
agent any
stages {
stage('ready') {
steps {
sh 'echo "ready"'
}
}
stage('build') {
steps {
sh 'xcodebuild -list -project "BullsEye/BullsEye.xcodeproj"'
}
}
}
}