match 0.8.1 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7d0367ebbd35eee9ee47b25a0734135b7c581d4
4
- data.tar.gz: af1eed433bd624b38b68a04f0b2810beba05da74
3
+ metadata.gz: f3cf7e4c9af9050a9b6e8f6a7c5c760bc281c92b
4
+ data.tar.gz: c76983326e8d722aeff558973124604555adf5e0
5
5
  SHA512:
6
- metadata.gz: e27b794c23fac1878dbd1a814ab910244d965247fd387d2d84d06ad2dd96e0fee9d96750792420e3767b18631cedd6c639ffd5f29ef2a8716447627da104a558
7
- data.tar.gz: 41a7f0fd1c24d790147a3e03c94c7ac8cb31402a4d79f89bcfdbeddafb55d511eb30af092c70ba651c15101a815aa141e274570614430c8e2dcb95e44dc1ad13
6
+ metadata.gz: e4aca4ba5efcd4ab989d0d04969b418632ae2840de179a9ad3469d2f43655809495753a34d8d1aa8202231951790fafbf1da7291093065d03cd1330024ca1292
7
+ data.tar.gz: 89e4be72b960293545dc25678dc71db2402f4da7c8fb4ec280be44d2bc2574376b861ab43e685e822d30d58bcef8b0afa2921943687c810695a909d55081151d
data/README.md CHANGED
@@ -32,7 +32,6 @@ match
32
32
  [![Twitter: @FastlaneTools](https://img.shields.io/badge/contact-@FastlaneTools-blue.svg?style=flat)](https://twitter.com/FastlaneTools)
33
33
  [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/fastlane/fastlane/blob/master/match/LICENSE)
34
34
  [![Gem](https://img.shields.io/gem/v/match.svg?style=flat)](http://rubygems.org/gems/match)
35
- [![Build Status](https://img.shields.io/circleci/project/fastlane/fastlane/master.svg?style=flat)](https://circleci.com/gh/fastlane/fastlane)
36
35
 
37
36
  ###### Easily sync your certificates and profiles across your team using git
38
37
 
@@ -53,7 +52,7 @@ A new approach to iOS code signing: Share one code signing identity across your
53
52
 
54
53
  -------
55
54
 
56
- <h5 align="center"><code>match</code> is part of <a href="https://fastlane.tools">fastlane</a>: The easiest way to automate building and releasing your iOS and Android apps.</h5>
55
+ <h5 align="center"><code>match</code> is part of <a href="https://fastlane.tools">fastlane</a>: The easiest way to automate beta deployments and releases for your iOS and Android apps.</h5>
57
56
 
58
57
  ## Why match?
59
58
 
@@ -174,20 +173,17 @@ match --help
174
173
 
175
174
  #### Handle multiple targets
176
175
 
177
- If you have several targets with different bundle identifiers, call `match` for each of them:
176
+ If you have several targets with different bundle identifiers, supply them as a comma-separated list to match:
178
177
 
179
178
  ```
180
- match appstore -a tools.fastlane.app
181
- match appstore -a tools.fastlane.app.watchkitapp
179
+ match appstore -a tools.fastlane.app,tools.fastlane.app.watchkitapp
182
180
  ```
183
181
 
184
182
  You can make this even easier using [fastlane](https://github.com/fastlane/fastlane/tree/master/fastlane) by creating a `certificates` lane like this:
185
183
 
186
184
  ```
187
185
  lane :certificates do
188
- match(app_identifier: "com.krausefx.app1", readonly: true)
189
- match(app_identifier: "com.krausefx.app2", readonly: true)
190
- match(app_identifier: "com.krausefx.app3", readonly: true)
186
+ match(app_identifier: ["com.krausefx.app1", "com.krausefx.app2", "com.krausefx.app3"], readonly: true)
191
187
  end
192
188
  ```
193
189
 
@@ -282,8 +278,7 @@ match adhoc --force_for_new_devices
282
278
  If your app has multiple targets (e.g. Today Widget or WatchOS Extension)
283
279
 
284
280
  ```ruby
285
- match(app_identifier: "tools.fastlane.app", type: "appstore")
286
- match(app_identifier: "tools.fastlane.app.today_widget", type: "appstore")
281
+ match(app_identifier: ["tools.fastlane.app", "tools.fastlane.app.today_widget"], type: "appstore")
287
282
  ```
288
283
 
289
284
  `match` can even use the same one Git repository for all bundle identifiers.
@@ -393,7 +388,7 @@ Because of the potentially dangerous nature of In-House profiles we decided to n
393
388
 
394
389
  ## [`fastlane`](https://fastlane.tools) Toolchain
395
390
 
396
- - [`fastlane`](https://fastlane.tools): The easiest way to automate building and releasing your iOS and Android apps
391
+ - [`fastlane`](https://fastlane.tools): The easiest way to automate beta deployments and releases for your iOS and Android apps
397
392
  - [`deliver`](https://github.com/fastlane/fastlane/tree/master/deliver): Upload screenshots, metadata and your app to the App Store
398
393
  - [`snapshot`](https://github.com/fastlane/fastlane/tree/master/snapshot): Automate taking localized screenshots of your iOS app on every device
399
394
  - [`frameit`](https://github.com/fastlane/fastlane/tree/master/frameit): Quickly put your screenshots into the right device frames
@@ -2,7 +2,7 @@ git_url "[[GIT_URL]]"
2
2
 
3
3
  type "development" # The default type, can be: appstore, adhoc or development
4
4
 
5
- # app_identifier "tools.fastlane.app"
5
+ # app_identifier ["tools.fastlane.app", "tools.fastlane.app2"]
6
6
  # username "user@fastlane.tools" # Your Apple Developer Portal username
7
7
 
8
8
  # For all available options run `match --help`
@@ -33,15 +33,15 @@ module Match
33
33
  end
34
34
 
35
35
  # @return (String) The UUID of the newly generated profile
36
- def self.generate_provisioning_profile(params: nil, prov_type: nil, certificate_id: nil)
36
+ def self.generate_provisioning_profile(params: nil, prov_type: nil, certificate_id: nil, app_identifier: nil)
37
37
  require 'sigh'
38
38
 
39
39
  prov_type = :enterprise if Match.enterprise? && ENV["SIGH_PROFILE_ENTERPRISE"] && !params[:type] == "development"
40
40
 
41
- profile_name = ["match", profile_type_name(prov_type), params[:app_identifier]].join(" ")
41
+ profile_name = ["match", profile_type_name(prov_type), app_identifier].join(" ")
42
42
 
43
43
  values = {
44
- app_identifier: params[:app_identifier],
44
+ app_identifier: app_identifier,
45
45
  output_path: File.join(params[:workspace], "profiles", prov_type.to_s),
46
46
  username: params[:username],
47
47
  force: true,
@@ -5,14 +5,21 @@ module Match
5
5
 
6
6
  @dir = Dir.mktmpdir
7
7
 
8
- # GIT_TERMINAL_PROMPT will fail the `git clone` command if user credentials are missing
9
- command = "GIT_TERMINAL_PROMPT=0 git clone '#{git_url}' '#{@dir}'"
8
+ command = "git clone '#{git_url}' '#{@dir}'"
10
9
  command << " --depth 1" if shallow_clone
11
10
 
12
11
  UI.message "Cloning remote git repo..."
13
- FastlaneCore::CommandExecutor.execute(command: command,
14
- print_all: $verbose,
15
- print_command: $verbose)
12
+ begin
13
+ # GIT_TERMINAL_PROMPT will fail the `git clone` command if user credentials are missing
14
+ FastlaneCore::CommandExecutor.execute(command: "GIT_TERMINAL_PROMPT=0 #{command}",
15
+ print_all: $verbose,
16
+ print_command: $verbose)
17
+ rescue
18
+ UI.error("Error cloning certificates repo, please make sure you have read access to the repository you want to use")
19
+ UI.error("Run the following command manually to make sure you're properly authenticated:")
20
+ UI.command(command)
21
+ UI.user_error!("Error cloning certificates git repo, please make sure you have access to the repository - see instructions above")
22
+ end
16
23
 
17
24
  UI.user_error!("Error cloning repo, make sure you have access to it '#{git_url}'") unless File.directory?(@dir)
18
25
 
@@ -39,8 +46,6 @@ module Match
39
46
  [
40
47
  "[fastlane]",
41
48
  "Updated",
42
- params[:app_identifier],
43
- "for",
44
49
  params[:type].to_s
45
50
  ].join(" ")
46
51
  end
@@ -31,7 +31,8 @@ module Match
31
31
  FastlaneCore::ConfigItem.new(key: :app_identifier,
32
32
  short_option: "-a",
33
33
  env_name: "MATCH_APP_IDENTIFIER",
34
- description: "The bundle identifier of your app",
34
+ description: "The bundle identifier(s) of your app (comma-separated)",
35
+ is_string: false,
35
36
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)),
36
37
  FastlaneCore::ConfigItem.new(key: :username,
37
38
  short_option: "-u",
@@ -51,20 +52,20 @@ module Match
51
52
  FastlaneCore::ConfigItem.new(key: :team_id,
52
53
  short_option: "-b",
53
54
  env_name: "FASTLANE_TEAM_ID",
54
- description: "The ID of your team if you're in multiple teams",
55
+ description: "The ID of your Developer Portal team if you're in multiple teams",
55
56
  optional: true,
56
57
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id),
57
58
  verify_block: proc do |value|
58
- ENV["FASTLANE_TEAM_ID"] = value
59
+ ENV["FASTLANE_TEAM_ID"] = value.to_s
59
60
  end),
60
61
  FastlaneCore::ConfigItem.new(key: :team_name,
61
62
  short_option: "-l",
62
63
  env_name: "FASTLANE_TEAM_NAME",
63
- description: "The name of your team if you're in multiple teams",
64
+ description: "The name of your Developer Portal team if you're in multiple teams",
64
65
  optional: true,
65
66
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_name),
66
67
  verify_block: proc do |value|
67
- ENV["FASTLANE_TEAM_NAME"] = value
68
+ ENV["FASTLANE_TEAM_NAME"] = value.to_s
68
69
  end),
69
70
  FastlaneCore::ConfigItem.new(key: :verbose,
70
71
  env_name: "MATCH_VERBOSE",
@@ -12,17 +12,30 @@ module Match
12
12
  params[:workspace] = GitHelper.clone(params[:git_url], params[:shallow_clone], skip_docs: params[:skip_docs], branch: params[:git_branch])
13
13
  spaceship = SpaceshipEnsure.new(params[:username]) unless params[:readonly]
14
14
 
15
+ if params[:app_identifier].kind_of?(Array)
16
+ app_identifiers = params[:app_identifier]
17
+ else
18
+ app_identifiers = params[:app_identifier].to_s.split(/\s*,\s*/).uniq
19
+ end
20
+
15
21
  # Verify the App ID (as we don't want 'match' to fail at a later point)
16
- spaceship.bundle_identifier_exists(params) if spaceship
22
+ if spaceship
23
+ app_identifiers.each do |app_identifier|
24
+ spaceship.bundle_identifier_exists(username: params[:username], app_identifier: app_identifier)
25
+ end
26
+ end
17
27
 
18
28
  # Certificate
19
29
  cert_id = fetch_certificate(params: params)
20
- spaceship.certificate_exists(params, cert_id) if spaceship
21
-
22
- # Provisioning Profile
23
- uuid = fetch_provisioning_profile(params: params,
24
- certificate_id: cert_id)
25
- spaceship.profile_exists(params, uuid) if spaceship
30
+ spaceship.certificate_exists(username: params[:username], certificate_id: cert_id) if spaceship
31
+
32
+ # Provisioning Profiles
33
+ app_identifiers.each do |app_identifier|
34
+ uuid = fetch_provisioning_profile(params: params,
35
+ certificate_id: cert_id,
36
+ app_identifier: app_identifier)
37
+ spaceship.profile_exists(username: params[:username], uuid: uuid) if spaceship
38
+ end
26
39
 
27
40
  # Done
28
41
  if self.changes_to_commit and !params[:readonly]
@@ -30,7 +43,10 @@ module Match
30
43
  GitHelper.commit_changes(params[:workspace], message, params[:git_url], params[:git_branch])
31
44
  end
32
45
 
33
- TablePrinter.print_summary(params)
46
+ # Print a summary table for each app_identifier
47
+ app_identifiers.each do |app_identifier|
48
+ TablePrinter.print_summary(app_identifier: app_identifier, type: params[:type])
49
+ end
34
50
 
35
51
  UI.success "All required keys, certificates and provisioning profiles are installed 🙌".green
36
52
  rescue Spaceship::Client::UnexpectedResponse, Spaceship::Client::InvalidUserCredentialsError, Spaceship::Client::NoUserCredentialsError => ex
@@ -75,8 +91,7 @@ module Match
75
91
  end
76
92
 
77
93
  # @return [String] The UUID of the provisioning profile so we can verify it with the Apple Developer Portal
78
- def fetch_provisioning_profile(params: nil, certificate_id: nil)
79
- app_identifier = params[:app_identifier]
94
+ def fetch_provisioning_profile(params: nil, certificate_id: nil, app_identifier: nil)
80
95
  prov_type = params[:type].to_sym
81
96
 
82
97
  profile_name = [Match::Generator.profile_type_name(prov_type), app_identifier].join("_").gsub("*", '\*') # this is important, as it shouldn't be a wildcard
@@ -93,7 +108,8 @@ module Match
93
108
  UI.user_error!("No matching provisioning profiles found and can not create a new one because you enabled `readonly`") if params[:readonly]
94
109
  profile = Generator.generate_provisioning_profile(params: params,
95
110
  prov_type: prov_type,
96
- certificate_id: certificate_id)
111
+ certificate_id: certificate_id,
112
+ app_identifier: app_identifier)
97
113
  self.changes_to_commit = true
98
114
  end
99
115
 
@@ -20,42 +20,44 @@ module Match
20
20
  Spaceship.select_team
21
21
  end
22
22
 
23
- def bundle_identifier_exists(params)
24
- found = Spaceship.app.find(params[:app_identifier])
23
+ def bundle_identifier_exists(username: nil, app_identifier: nil)
24
+ found = Spaceship.app.find(app_identifier)
25
25
  return if found
26
26
 
27
27
  require 'sigh'
28
28
  Sigh::Runner.new.print_produce_command({
29
- username: params[:username],
30
- app_identifier: params[:app_identifier]
29
+ username: username,
30
+ app_identifier: app_identifier
31
31
  })
32
32
  UI.error("An app with that bundle ID needs to exist in order to create a provisioning profile for it")
33
33
  UI.error("================================================================")
34
+ available_apps = Spaceship.app.all.collect { |a| "#{a.bundle_id} (#{a.name})" }
35
+ UI.message("Available apps:\n- #{available_apps.join("\n- ")}")
34
36
  UI.error("Make sure to run `match` with the same user and team every time.")
35
- UI.user_error!("Couldn't find bundle identifier '#{params[:app_identifier]}' for the user '#{params[:username]}'")
37
+ UI.user_error!("Couldn't find bundle identifier '#{app_identifier}' for the user '#{username}'")
36
38
  end
37
39
 
38
- def certificate_exists(params, certificate_id)
40
+ def certificate_exists(username: nil, certificate_id: nil)
39
41
  found = Spaceship.certificate.all.find do |cert|
40
42
  cert.id == certificate_id
41
43
  end
42
44
  return if found
43
45
 
44
46
  UI.error("Certificate '#{certificate_id}' (stored in your git repo) is not available on the Developer Portal")
45
- UI.error("for the user #{params[:username]}")
47
+ UI.error("for the user #{username}")
46
48
  UI.error("Make sure to use the same user and team every time you run 'match' for this")
47
49
  UI.error("Git repository. This might be caused by revoking the certificate on the Dev Portal")
48
50
  UI.user_error!("To reset the certificates of your Apple account, you can use the `match nuke` feature, more information on https://github.com/fastlane/fastlane/tree/master/match")
49
51
  end
50
52
 
51
- def profile_exists(params, uuid)
53
+ def profile_exists(username: nil, uuid: nil)
52
54
  found = Spaceship.provisioning_profile.all.find do |profile|
53
55
  profile.uuid == uuid
54
56
  end
55
57
  return if found
56
58
 
57
59
  UI.error("Provisioning profile '#{uuid}' is not available on the Developer Portal")
58
- UI.error("for the user #{params[:username]}")
60
+ UI.error("for the user #{username}")
59
61
  UI.error("Make sure to use the same user and team every time you run 'match' for this")
60
62
  UI.error("Git repository. This might be caused by deleting the provisioning profile on the Dev Portal")
61
63
  UI.user_error!("To reset the provisioning profiles of your Apple account, you can use the `match nuke` feature, more information on https://github.com/fastlane/fastlane/tree/master/match")
@@ -1,10 +1,9 @@
1
1
  module Match
2
2
  class TablePrinter
3
- def self.print_summary(params)
3
+ def self.print_summary(app_identifier: nil, type: nil)
4
4
  rows = []
5
5
 
6
- app_identifier = params[:app_identifier]
7
- type = params[:type].to_sym
6
+ type = type.to_sym
8
7
 
9
8
  rows << ["App Identifier", "", app_identifier]
10
9
  rows << ["Type", "", type]
@@ -1,4 +1,4 @@
1
1
  module Match
2
- VERSION = "0.8.1"
2
+ VERSION = "0.9.0"
3
3
  DESCRIPTION = "Easily sync your certificates and profiles across your team using git"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: match
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-05 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: security
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.52.1
33
+ version: 0.53.0
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.0.0
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 0.52.1
43
+ version: 0.53.0
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.0.0
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 0.16.1
53
+ version: 0.16.2
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
56
  version: 1.0.0
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 0.16.1
63
+ version: 0.16.2
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.0.0
@@ -70,7 +70,7 @@ dependencies:
70
70
  requirements:
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 0.34.2
73
+ version: 0.36.1
74
74
  - - "<"
75
75
  - !ruby/object:Gem::Version
76
76
  version: 1.0.0
@@ -80,7 +80,7 @@ dependencies:
80
80
  requirements:
81
81
  - - ">="
82
82
  - !ruby/object:Gem::Version
83
- version: 0.34.2
83
+ version: 0.36.1
84
84
  - - "<"
85
85
  - !ruby/object:Gem::Version
86
86
  version: 1.0.0
@@ -256,14 +256,14 @@ dependencies:
256
256
  requirements:
257
257
  - - "~>"
258
258
  - !ruby/object:Gem::Version
259
- version: 0.38.0
259
+ version: 0.44.0
260
260
  type: :development
261
261
  prerelease: false
262
262
  version_requirements: !ruby/object:Gem::Requirement
263
263
  requirements:
264
264
  - - "~>"
265
265
  - !ruby/object:Gem::Version
266
- version: 0.38.0
266
+ version: 0.44.0
267
267
  description: Easily sync your certificates and profiles across your team using git
268
268
  email:
269
269
  - match@krausefx.com