Automated cherry pick of #3476 (#3483)

* Fix android and iOS deployment on circleCI

* Feedback review

* Fix circleci yml
This commit is contained in:
Mattermost Build 2019-10-28 12:49:15 +01:00 committed by Elias Nahum
parent cdb3abfadb
commit 0549326970
2 changed files with 32 additions and 35 deletions

View file

@ -159,39 +159,30 @@ commands:
no_output_timeout: 30m
command: bundle exec fastlane ios build || exit 1
deploy-android:
description: "Deploy apk to Google Play"
deploy-to-store:
description: "Deploy build to store"
parameters:
apk_path:
task:
type: string
target:
type: string
file:
type: string
steps:
- attach_workspace:
at: ~/mattermost-mobile
- deploy:
name: "Deploy apk to Google Play"
at: /
- run:
name: <<parameters.task>>
working_directory: fastlane
command: bundle exec fastlane android deploy apk:./<<parameters.apk_path>>
deploy-ios:
description: "Deploy ipa to TestFlight"
parameters:
ipa_path:
type: string
steps:
- attach_workspace:
at: ~/mattermost-mobile
- deploy:
name: "Deploy ipa to TestFlight"
working_directory: fastlane
command: bundle exec fastlane ios deploy ipa:./<<parameters.ipa_path>>
command: bundle exec fastlane <<parameters.target>> deploy file:$HOME/mattermost-mobile/<<parameters.file>>
persist:
description: "Persist mattermost-mobile directory"
steps:
- persist_to_workspace:
root: ./
root: /
paths:
- ./
- mattermost-mobile*
save:
description: "Save binaries artifacts"
@ -244,7 +235,6 @@ jobs:
BRANCH_TO_BUILD: ${CIRCLE_BRANCH}
steps:
- build-android
- persist
- save:
filename: "Mattermost_Beta.apk"
@ -270,7 +260,6 @@ jobs:
BRANCH_TO_BUILD: ${CIRCLE_BRANCH}
steps:
- build-ios
- persist
- save:
filename: "Mattermost_Beta.ipa"
@ -279,28 +268,36 @@ jobs:
name: android
resource_class: medium
steps:
- deploy-android:
apk_path: Mattermost.apk
- deploy-to-store:
task: "Deploy to Google Play"
target: android
file: Mattermost.apk
deploy-android-beta:
executor:
name: android
resource_class: medium
steps:
- deploy-android:
apk_path: Mattermost_Beta.apk
- deploy-to-store:
task: "Deploy to Google Play"
target: android
file: Mattermost_Beta.apk
deploy-ios-release:
executor: ios
steps:
- deploy-ios:
ipa_path: Mattermost.ipa
- deploy-to-store:
task: "Deploy to TestFlight"
target: ios
file: Mattermost.ipa
deploy-ios-beta:
executor: ios
steps:
- deploy-ios:
ipa_path: Mattermost_Beta.ipa
- deploy-to-store:
task: "Deploy to TestFlight"
target: ios
file: Mattermost_Beta.ipa
workflows:
version: 2

View file

@ -428,7 +428,7 @@ platform :ios do
end
lane :deploy do |options|
ipa_path = options[:ipa]
ipa_path = options[:file]
unless ipa_path.nil?
submit_to_testflight(ipa_path)
@ -612,7 +612,7 @@ platform :android do
end
lane :deploy do |options|
apk_path = options[:apk]
apk_path = options[:file]
unless apk_path.nil?
submit_to_google_play(apk_path)
@ -729,7 +729,7 @@ def submit_to_testflight(ipa_path)
if(File.file?(ipa_path))
UI.success("ipa file #{ipa_path}")
upload_to_tesflight(
pilot(
ipa: ipa_path
)
else