|
| 1 | +pipeline { |
| 2 | + agent { label 'osx && arm64' } |
| 3 | + options { |
| 4 | + buildDiscarder(logRotator(numToKeepStr: '135', daysToKeepStr: '21')) |
| 5 | + gitLabConnection('GitLabConnectionJenkins') |
| 6 | + ansiColor('xterm') |
| 7 | + } |
| 8 | + environment { |
| 9 | + APIURL_TO_TEST = "https://g.api.mega.co.nz/" |
| 10 | + IOS_BRANCH = "develop" |
| 11 | + SDK_BRANCH = "develop" |
| 12 | + MEGACHAT_BRANCH = "develop" |
| 13 | + } |
| 14 | + stages { |
| 15 | + stage('Checkout SDK MEGAchat and iOS'){ |
| 16 | + steps { |
| 17 | + deleteDir() |
| 18 | + checkout([ |
| 19 | + $class: 'GitSCM', |
| 20 | + branches: [[name: "origin/${env.IOS_BRANCH}"]], |
| 21 | + userRemoteConfigs: [[ url: "[email protected]:mobile/ios/iOS_dev.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]], |
| 22 | + extensions: [ |
| 23 | + [$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"] |
| 24 | + ] |
| 25 | + ]) |
| 26 | + dir("Modules/DataSource/MEGAChatSDK/Sources/MEGAChatSDK"){ |
| 27 | + checkout([ |
| 28 | + $class: 'GitSCM', |
| 29 | + branches: [[name: "origin/${env.MEGACHAT_BRANCH}"]], |
| 30 | + userRemoteConfigs: [[ url: "[email protected]:megachat/MEGAchat.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]], |
| 31 | + extensions: [ |
| 32 | + [$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"], |
| 33 | + ] |
| 34 | + ]) |
| 35 | + } |
| 36 | + dir('Modules/Datasource/MEGASDK/Sources/MEGASDK'){ |
| 37 | + checkout([ |
| 38 | + $class: 'GitSCM', |
| 39 | + branches: [[name: "origin/${env.SDK_BRANCH}"]], |
| 40 | + userRemoteConfigs: [[ url: "[email protected]:sdk/sdk.git", credentialsId: "12492eb8-0278-4402-98f0-4412abfb65c1" ]], |
| 41 | + extensions: [ |
| 42 | + [$class: "UserIdentity",name: "jenkins", email: "jenkins@jenkins"] |
| 43 | + ] |
| 44 | + ]) |
| 45 | + } |
| 46 | + sh """ |
| 47 | + git submodule update --init iMEGA/Vendor/SVProgressHUD |
| 48 | + git submodule update --init iMEGA/Vendor/LTHPasscodeViewController |
| 49 | + """ |
| 50 | + script{ |
| 51 | + ios_sources_workspace = WORKSPACE |
| 52 | + sdk_sources_workspace = "${ios_sources_workspace}/Modules/DataSource/MEGASDK/Sources/MEGASDK" |
| 53 | + megachat_sources_workspace = "${ios_sources_workspace}/Modules/DataSource/MEGAChatSDK/Sources/MEGAChatSDK" |
| 54 | + } |
| 55 | + } |
| 56 | + } |
| 57 | + stage('Build MEGACHAT SDK and iOS'){ |
| 58 | + environment{ |
| 59 | + PATH = "/usr/local/bin:${env.PATH}" |
| 60 | + LIBTOOLIZE = "/usr/local/bin/glibtoolize" |
| 61 | + } |
| 62 | + steps{ |
| 63 | + sh """ |
| 64 | + bundle config set --local path 'vendor/bundle' |
| 65 | + bundle install |
| 66 | + """ |
| 67 | + dir("${megachat_sources_workspace}/src"){ |
| 68 | + sh """ |
| 69 | + cmake -P genDbSchema.cmake |
| 70 | + """ |
| 71 | + } |
| 72 | + sh """ |
| 73 | + bundle exec fastlane configure_sdk_and_chat_library use_cache:true |
| 74 | + """ |
| 75 | + withCredentials([gitUsernamePassword(credentialsId: 'jenkins_sdk_token_with_user', gitToolName: 'Default')]) { |
| 76 | + sh """ |
| 77 | + bundle exec fastlane update_plugins |
| 78 | + bundle exec fastlane build_simulator |
| 79 | + """ |
| 80 | + } |
| 81 | + } |
| 82 | + } |
| 83 | + } |
| 84 | + post { |
| 85 | + always { |
| 86 | + deleteDir() |
| 87 | + } |
| 88 | + } |
| 89 | +} |
| 90 | +// vim: syntax=groovy tabstop=4 shiftwidth=4 |
0 commit comments