Integração CI / CD para vários ambientes com Jenkins e Fastlane. Parte 1

Antecipando o início do curso "Desenvolvedor iOS. Básico", tradicionalmente preparamos uma tradução interessante para você e também o convidamos a se inscrever em um seminário on-line gratuito, no qual nossos especialistas falarão em detalhes sobre o programa do curso e também responderão às suas perguntas.


Incorporar tecnologias de Integração Contínua (CI) e Entrega Contínua (CD) no processo de desenvolvimento é inegavelmente a única maneira de rastrear a relevância das mudanças de código e identificar erros de integração nos estágios iniciais. É também o caminho para compilações depuradas que estão quase imediatamente disponíveis para teste e prontas para serem enviadas para produção, mesmo após alterações significativas no código.

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