通过Jenkins和Fastlane在多个环境中进行CI / CD集成。第1部分

传统上预期“ iOS Developer。Basic”课程的开始,我们通常会为您准备一份有趣的翻译,并且我们还邀请您注册免费的网络研讨会,我们的专家将在其中详细介绍该课程计划并回答您的问题。


毫无疑问,将持续集成(CI)和持续交付(CD)技术整合到开发过程中是唯一可在早期阶段跟踪代码更改的相关性并识别集成错误的方法。它也是通向几乎可立即用于测试并甚至在重大代码更改后即可投入生产的调试版本的途径。

CI/CD , : -, , , , -, , // , .

, , ? Jenkins Fastlane  - , , .

, , Jenkins Fastlane CI . , .

Jenkins Fastlane

, CI , , Jenkins Fastlane . , Jenkins - , Java, . Jenkins (Pipelines), , (Jobs), , , , , , , . , (), Fastlane.

Fastlane - , (iOS Android), , , , . Fastlane , Lanes, , , Actions, , .

, , , - iOS- Testflight, (, , , , ) . , Testflight :

a)

b) ,

?.

, Jenkins Fastlane . , , . , Jenkins , Jenkins - Github . Github, Xcode, SCM (Source Control Management), , Github, Credentials Plugin , .

Jenkins. , Testflight.

Jenkins () => New Item (Pipeline) (Job) Jenkins “Upload to Testflight”.

 

Configure , . .

Definition , Pipeline «Pipeline Script from SCM». (SCM), Git-.

- , Testflight, github, github.

, , .

«Save» ! Jenkins. !

Scripted Pipeline. , (stages), , . Testflight, , . , :

  1. Testflight

, , Build with Parameters , , , :

, Build, , Jenkins Stage view:

, Testflight!

, , , . Console Output , , , .

, MyScript.groovy, deploy(), :

1.

checkout SCM, , Jenkins Pipeline.

stage('Checkout') {
    checkout scm
}

2.

stage('Install dependencies') {
      sh 'gem install bundler'
      sh 'bundle update'
      sh 'bundle exec pod repo update'
      sh 'bundle exec pod install'
}

CocoaPods, pod install, . - Bundler, Ruby. 2 , Bundler, Bundler , Gemfile . , , , Fastlane, , , Danger, ruby . pod repo update, pod', , , pod update, .

3.

stage('Reset Simulators') {
   sh 'bundle exec fastlane snapshot resetsimulators --force'
}

, , , , .

, Fastlane . , Fastlane Lanes , Fastfile. , , .

iOS-, , « » .

4.

stage('Run Tests') {
   sh 'bundle exec fastlane test'
}

. test , Fastfile, :

lane :test do
    scan(
        clean: true,
        devices: ["iPhone X"],
        workspace: "ourproject.xcworkspace",
        scheme: "productionscheme",
        codecoverage: true,
        outputdirectory: "./testoutput",
        outputtypes: "html,junit"
    )
    slather(
        coberturaxml: true,
        proj: "ourproject.xcodeproj",
        workspace: "ourproject.xcworkspace",
        outputdirectory: "./testoutput",
        scheme: "productionscheme",
        jenkins: true,
        ignore: [arrayofdocstoignore]
    )
end

 

Fastlane: scan slather.

Scan , workspace ( ), scheme (), codecoverage ( ) , , devices (), , .

Slather , , , , (ignore).

Fastlane- ✨. , Jenkins. , , , , .


, .

, .




All Articles