美文网首页
IOS Continuous Integration

IOS Continuous Integration

作者: 夜阑w | 来源:发表于2019-12-09 15:19 被阅读0次

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"'
            }
        }
    }
}

相关文章

网友评论

      本文标题:IOS Continuous Integration

      本文链接:https://www.haomeiwen.com/subject/ygvbgctx.html