Jenkins
Jenkins is a CI tool.
Install
brew update
brew install jenkins
Run
brew services start jenkins
在浏览器中访问http://localhost:8080/,根据提示进行操作,直至出现Jenkins的操作界面
Creating your first Pipeline
- 在左上角点击New Item新建pipeline,输入一个名字,选择Pipeline,点击OK
- 在Pipeline中设置Definition为
Pipeline script from SCM
,设置SCM为Git
,并添加仓库地址 - 创建Jenkinsfile文件,内容示例
// 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文件中的内容来build iOS项目
pipeline {
agent any
stages {
stage('ready') {
steps {
sh 'echo "ready"'
}
}
stage('build') {
steps {
sh 'xcodebuild -list -project "BullsEye/BullsEye.xcodeproj"'
}
}
}
}