Skip to content

Commit

Permalink
Start calling the new ios_send_app_metrics action
Browse files Browse the repository at this point in the history
  • Loading branch information
AliSoftware committed May 9, 2022
1 parent c3f33ab commit e6ac9dc
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions fastlane/lanes/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
SENTRY_PROJECT_SLUG_JETPACK = 'jetpack-ios'
APPCENTER_OWNER_NAME = 'automattic'
APPCENTER_OWNER_TYPE = 'organization'
APP_THINNING_EXPORT_OPTIONS = { thinning: '<thin-for-all-variants>' }

# TODO: Remove this once I'm done with debugging the App Metrics endpoint
ENV['APPMETRICS_BASE_URL'] = 'localhost'
ENV['APPMETRICS_API_TOKEN'] = 'tok/1'

# Lanes related to Building and Testing the code
#
Expand Down Expand Up @@ -198,7 +203,7 @@
derived_data_path: DERIVED_DATA_PATH,
export_team_id: get_required_env('INT_EXPORT_TEAM_ID'),
export_method: 'enterprise',
export_options: { method: 'enterprise' }
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
)

appcenter_upload(
Expand All @@ -217,6 +222,14 @@
project_slug: SENTRY_PROJECT_SLUG_WORDPRESS,
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
)

ios_send_app_metrics(
api_base_url: ENV['APPMETRICS_BASE_URL'],
api_token: ENV['APPMETRICS_API_TOKEN'],
app_name: 'wordpress',
build_type: 'internal',
app_version: ios_get_build_version,
)
end

# Builds the WordPress app for an Installable Build ("WordPress Alpha" scheme), and uploads it to App Center
Expand Down Expand Up @@ -247,7 +260,7 @@
derived_data_path: DERIVED_DATA_PATH,
export_team_id: ENV['INT_EXPORT_TEAM_ID'],
export_method: 'enterprise',
export_options: { method: 'enterprise' }
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
)

appcenter_upload(
Expand All @@ -268,6 +281,14 @@
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
)

ios_send_app_metrics(
api_base_url: ENV['APPMETRICS_BASE_URL'],
api_token: ENV['APPMETRICS_API_TOKEN'],
app_name: 'wordpress',
build_type: 'pr-installable-build',
app_version: build_number,
)

post_installable_build_pr_comment(app_name: 'WordPress', build_number: build_number, url_slug: 'WPiOS-One-Offs')
end

Expand Down Expand Up @@ -300,7 +321,7 @@
derived_data_path: DERIVED_DATA_PATH,
export_team_id: ENV['INT_EXPORT_TEAM_ID'],
export_method: 'enterprise',
export_options: { method: 'enterprise' }
export_options: { method: 'enterprise', **APP_THINNING_EXPORT_OPTIONS }
)

appcenter_upload(
Expand All @@ -321,6 +342,14 @@
dsym_path: lane_context[SharedValues::DSYM_OUTPUT_PATH]
)

ios_send_app_metrics(
api_base_url: ENV['APPMETRICS_BASE_URL'],
api_token: ENV['APPMETRICS_API_TOKEN'],
app_name: 'jetpack',
build_type: 'pr-installable-build',
app_version: build_number,
)

post_installable_build_pr_comment(app_name: 'Jetpack', build_number: build_number, url_slug: 'jetpack-installable-builds')
end

Expand Down

0 comments on commit e6ac9dc

Please sign in to comment.