Integración CI / CD para múltiples entornos con Jenkins y Fastlane. Parte 1

Anticipándonos al inicio del curso "Desarrollador iOS. Básico", tradicionalmente hemos preparado una traducción interesante para usted, y también lo invitamos a inscribirse en un seminario web gratuito, en el que nuestros expertos le informarán en detalle sobre el programa del curso y también responderán sus preguntas.


La incorporación de tecnologías de Integración Continua (CI) y Entrega Continua (CD) en el proceso de desarrollo es sin duda la única forma de rastrear la relevancia de los cambios de código e identificar errores de integración en las primeras etapas. También es el camino a las compilaciones depuradas que están casi inmediatamente disponibles para pruebas y listas para enviarse a producción incluso después de cambios significativos en el 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