Skip to content

Commit 6fbc388

Browse files
[RANGR-975] Remove AppCenter and update Runway comment with NitroAppPortal link (#523)
Task on Runway [RANGR-975](https://nitro.powerhrg.com/runway/backlog_items/RANGR-975).
1 parent 5a11c08 commit 6fbc388

File tree

5 files changed

+12
-94
lines changed

5 files changed

+12
-94
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source "https://rubygems.org"
33
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
44

55
gem "fastlane", "~> 2.227.0"
6-
gem "json", "~> 2.10.1"
6+
gem "json", "~> 2.10.2"
77
gem 'httparty'
88

99
# Until Fastlane includes them directly.

Gemfile.lock

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ GEM
1111
artifactory (3.0.17)
1212
atomos (0.1.3)
1313
aws-eventstream (1.3.2)
14-
aws-partitions (1.1066.0)
14+
aws-partitions (1.1070.0)
1515
aws-sdk-core (3.220.1)
1616
aws-eventstream (~> 1, >= 1.3.0)
1717
aws-partitions (~> 1, >= 1.992.0)
@@ -35,7 +35,7 @@ GEM
3535
colored2 (3.1.2)
3636
commander (4.6.0)
3737
highline (~> 2.0.0)
38-
csv (3.3.2)
38+
csv (3.3.3)
3939
declarative (0.0.20)
4040
digest-crc (0.7.0)
4141
rake (>= 12.0.0, < 14.0.0)
@@ -114,8 +114,6 @@ GEM
114114
xcodeproj (>= 1.13.0, < 2.0.0)
115115
xcpretty (~> 0.4.0)
116116
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
117-
fastlane-plugin-appcenter (2.1.3)
118-
csv
119117
fastlane-sirp (1.0.0)
120118
sysrandom (~> 1.0)
121119
gh_inspector (1.1.3)
@@ -233,10 +231,9 @@ PLATFORMS
233231
DEPENDENCIES
234232
abbrev
235233
fastlane (~> 2.227.0)
236-
fastlane-plugin-appcenter
237234
httparty
238-
json (~> 2.10.1)
235+
json (~> 2.10.2)
239236
mutex_m
240237

241238
BUNDLED WITH
242-
2.6.2
239+
2.6.6

Jenkinsfile

+2-7
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ secrets = [
2121
credentialsId: 'nitro-runway-api-token-tps-40',
2222
variable: 'RUNWAY_API_TOKEN'
2323
],
24-
appcenter: [
25-
credentialsId: 'appcenter-token',
26-
variable: 'APPCENTER_API_TOKEN'
27-
],
2824
nitro_mdm: [
2925
credentialsId: 'a5876938-2cc6-4921-9aaa-12f224fe60fe',
3026
variable: 'NITRO_MDM_API_KEY'
@@ -138,7 +134,6 @@ def setupEnv(block) {
138134
withCredentials([
139135
string(secrets.github),
140136
string(secrets.runway),
141-
string(secrets.appcenter),
142137
string(secrets.nitro_mdm),
143138
string(secrets.fastlane_app_pass)
144139
]) {
@@ -263,7 +258,7 @@ def uploadiOS() {
263258
def version = sh(script: "xcodebuild -project 'PlaybookShowcase/PlaybookShowcase.xcodeproj' -target 'PlaybookShowcase-iOS' " +
264259
"-showBuildSettings | grep MARKETING_VERSION | sed 's/.*= //'", returnStdout: true).trim()
265260

266-
fastlane("upload_ios suffix:${buildSuffix()} type:${buildType()} release_notes:\"${trimmedReleaseNotes}\" appcenter_token:${APPCENTER_API_TOKEN} " +
261+
fastlane("upload_ios suffix:${buildSuffix()} type:${buildType()} release_notes:\"${trimmedReleaseNotes}\" " +
267262
"nitro_mdm_api_token:${NITRO_MDM_API_KEY} build_number:${buildNum} version:${version} pr_number:\"${pullRequestID}\"")
268263
}
269264

@@ -274,7 +269,7 @@ def uploadmacOS() {
274269
def version = sh(script: "xcodebuild -project 'PlaybookShowcase/PlaybookShowcase.xcodeproj' -target 'PlaybookShowcase-macOS' " +
275270
"-showBuildSettings | grep MARKETING_VERSION | sed 's/.*= //'", returnStdout: true).trim()
276271

277-
fastlane("upload_macos suffix:${buildSuffix()} type:${buildType()} release_notes:\"${trimmedReleaseNotes}\" appcenter_token:${APPCENTER_API_TOKEN} " +
272+
fastlane("upload_macos suffix:${buildSuffix()} type:${buildType()} release_notes:\"${trimmedReleaseNotes}\" " +
278273
"nitro_mdm_api_token:${NITRO_MDM_API_KEY} build_number:${buildNum} version:${version} pr_number:\"${pullRequestID}\"")
279274
}
280275

fastlane/Fastfile

+5-74
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515

1616
require 'httparty'
1717

18-
zip_file = ''
19-
2018
default_platform(:ios)
2119

2220
build_path = "BuildTemp/Archives"
2321
derived_data_path = "DerivedData"
2422
ios_plist = "./Info.plist"
25-
appcenter_token = "bf0ae509c985f2a1102c2ad53894b35a5fa5383e"
2623
project = './PlaybookShowcase/PlaybookShowcase.xcodeproj'
2724

2825
def target_ios(suffix = nil)
@@ -106,35 +103,11 @@ end
106103
desc "Upload iOS build"
107104
lane :upload_ios do |opts|
108105
keep_trying {
109-
ship_ios_to_appcenter(opts)
110106
opts[:platform] = "ios"
111107
distribute_to_mdm(opts)
112108
}
113109
end
114110

115-
desc "Ship iOS to App Center"
116-
lane :ship_ios_to_appcenter do |opts|
117-
118-
app_name = "Playbook-Showcase-Beta"
119-
if opts[:type] == 'production'
120-
app_name = "Playbook-Showcase"
121-
end
122-
123-
opts[:os] = 'ios'
124-
appcenter_upload(
125-
api_token: appcenter_token,
126-
owner_name: "powerhome",
127-
owner_type: "organization",
128-
app_name: app_name,
129-
file: "#{target_ios(opts[:suffix])}.ipa",
130-
version: "#{opts[:build_number]}",
131-
release_notes: "#{opts[:release_notes]}",
132-
destinations: "Rebels",
133-
destination_type: "group",
134-
upload_build_only: false
135-
)
136-
end
137-
138111
desc "Export App Pass to Environment"
139112
lane :export_app_pass do |opts|
140113
# Add app-specific-password to environment variable
@@ -156,40 +129,11 @@ end
156129
desc "Upload macOS build"
157130
lane :upload_macos do |opts|
158131
keep_trying {
159-
ship_macos_to_appcenter(opts)
160132
opts[:platform] = "macos"
161133
distribute_to_mdm(opts)
162134
}
163135
end
164136

165-
desc "Ship macOS to App Center"
166-
lane :ship_macos_to_appcenter do |opts|
167-
168-
app_name = "Playbook-Swift-Mac-Beta"
169-
if opts[:type] == 'production'
170-
app_name = "Playbook-Swift-Mac"
171-
end
172-
173-
#compress file
174-
zip_file = "#{target_macos(opts[:suffix])}.zip"
175-
sh "ditto -c -k --sequesterRsrc --keepParent '../#{target_macos(opts[:suffix])}.app' '../#{zip_file}'"
176-
177-
opts[:os] = 'macos'
178-
appcenter_upload(
179-
api_token: appcenter_token,
180-
owner_name: "powerhome",
181-
owner_type: "organization",
182-
app_name: app_name,
183-
app_os: "macOS",
184-
file: zip_file,
185-
version: "#{opts[:build_number]}",
186-
release_notes: "#{opts[:release_notes]}",
187-
destinations: "Rebels",
188-
destination_type: "group",
189-
upload_build_only: false
190-
)
191-
end
192-
193137
desc "Upload to Nitro MDM"
194138
lane :distribute_to_mdm do |opts|
195139

@@ -212,7 +156,7 @@ lane :distribute_to_mdm do |opts|
212156

213157
file_path = "../#{target_ios(opts[:suffix])}.ipa"
214158
if platform == "macos"
215-
file_path = "../#{zip_file}"
159+
file_path = "../#{target_macos(opts[:suffix])}.app.zip"
216160
end
217161
output_file = "../upload-build-to-nitro-details.json"
218162

@@ -251,34 +195,21 @@ lane :create_runway_comment do |opts|
251195
build_number = opts[:build_number]
252196
release_notes = "#{opts[:release_notes]}"
253197

254-
ios_app_name = "Playbook-Showcase-Beta"
255-
if type == 'production'
256-
app_name = "Playbook-Showcase"
257-
end
258-
259-
macos_app_name = "Playbook-Swift-Mac-Beta"
198+
app_id = "com.powerhrg.PlaybookShowcase.dev"
260199
if type == 'production'
261-
app_name = "Playbook-Swift-Mac"
200+
app_name = "com.powerhrg.PlaybookShowcase"
262201
end
263202

264203
merged_comment = ''
265204
if type == 'production'
266205
merged_comment = "✅ MERGED ✅\n\n"
267206
end
268207

269-
# https://install.appcenter.ms/orgs/powerhome/apps/#{app_name}/releases/#{release_num}
270-
# Generate the link above based on this call:
271-
version_info = appcenter_fetch_version_number(
272-
api_token: appcenter_token,
273-
owner_name: "powerhome",
274-
app_name: ios_app_name
275-
)
276-
277208
comment = <<~HEREDOC
278209
<p><b>#{merged_comment}#{type} build #{build_number}</b></p>
279210
<ul>
280-
<li>PlaybookShowcase-iOS: <a href=#{"https://install.appcenter.ms/orgs/powerhome/apps/#{ios_app_name}/releases/#{version_info["id"]}"}>iOS</a></li>
281-
<li>PlaybookShowcase-macOS: <a href=#{"https://install.appcenter.ms/orgs/powerhome/apps/#{macos_app_name}/releases/#{version_info["id"]}"}>macOS</a></li>
211+
<li>PlaybookShowcase-iOS: <a href=#{"https://nitro.powerhrg.com/mdm/app_builds/#{app_id}/iOS"}>iOS Build #{build_number}</a></li>
212+
<li>PlaybookShowcase-macOS: <a href=#{"https://nitro.powerhrg.com/mdm/app_builds/#{app_id}/macOS"}>macOS Build #{build_number}</a></li>
282213
</ul>
283214
HEREDOC
284215

fastlane/Pluginfile

-5
This file was deleted.

0 commit comments

Comments
 (0)