fastlane-plugin-aws_s3 0.2.1 → 0.2.2

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: 1a352c57e53f5406a111832c0fd3b14c92db1683
4
- data.tar.gz: 76c4956e0f8f3abd737f3a40064cffef2802f849
3
+ metadata.gz: 3aaf513a3c224f2a23d038c6005f068cbcb865bc
4
+ data.tar.gz: 718db50abe2b1c3258ab82ebffb3828270fc3ad3
5
5
  SHA512:
6
- metadata.gz: 6ed8f148df62eb74aa7de573ba140a564b3a02126d1c37256570e6ac0f68ea1ce844e5401172dcf201a7e943b847023cd7487c6d004a9ea16c704d3743ea0d50
7
- data.tar.gz: c577cdf27707fc409ab0bdd4b89334a86017e551a92ee15ad79c0291ba37ce90f9b06a3a88a108c0332fff5ee9a5d6b9d66d723796443c4174ab7e0ac23b277d
6
+ metadata.gz: b32f82a441f776f9d3fc18d92af6220a4a83a33b4beb168d7ffdde610d8feeb39d9e0a82933839256393aafe38cf6561fc4e1ce486058267f9a690da8e65154f
7
+ data.tar.gz: 1cd12aa70a40c680f2d1e42ff91c92c81cf4d05e7601160dac5b43aa56044217475be96b052e351ade745a82cd69155414413a61c3f351d6c310ba1ab6c0c049
data/README.md CHANGED
@@ -14,7 +14,7 @@ fastlane add_plugin aws_s3
14
14
 
15
15
  Upload a new build to Amazon S3 to distribute the build to beta testers. Works for both Ad Hoc and Enterprise signed applications. This step will generate the necessary HTML, plist, and version files for you.
16
16
 
17
- The `aws_s3` action can upload both iOS apps (IPAs) and Android apps (APKs). It is **highly** suggested that you make a separate bucket for each of the apps.
17
+ The `aws_s3` action can upload both iOS apps (IPAs) and Android apps (APKs). If you would like to upload both iOS and Android apps to the same bucket, you can set the `app_directory` parameter so each app goes into their own S3 bucket directory.
18
18
 
19
19
  Below is what the default generated page looks like that gets hosted on S3.
20
20
 
@@ -40,7 +40,9 @@ aws_s3(
40
40
  ipa: 'AppName.ipa', # Required (if not uploading an APK).
41
41
  dsym: 'AppName.app.dSYM.zip', # Optional is you use `ipa` to build.
42
42
 
43
- apk: 'AppName.apk' # Required (if not uploading an IPA).
43
+ apk: 'AppName.apk', # Required (if not uploading an IPA).
44
+
45
+ app_directory: 'ios_or_android', # Optional but nice if you want to put multiple apps in same bucket
44
46
 
45
47
  path: 'v{CFBundleShortVersionString}_b{CFBundleVersion}/', # This is actually the default.
46
48
  upload_metadata: true, # Upload version.json, plist and HTML. Set to false to skip uploading of these files.
@@ -24,6 +24,7 @@ module Fastlane
24
24
  params[:secret_access_key] = config[:secret_access_key]
25
25
  params[:bucket] = config[:bucket]
26
26
  params[:region] = config[:region]
27
+ params[:app_directory] = config[:app_directory]
27
28
  params[:acl] = config[:acl]
28
29
  params[:source] = config[:source]
29
30
  params[:path] = config[:path]
@@ -69,6 +70,8 @@ module Fastlane
69
70
 
70
71
  s3_path = "v{CFBundleShortVersionString}_b{CFBundleVersion}/" unless s3_path
71
72
 
73
+ app_directory = params[:app_directory]
74
+
72
75
  plist_template_path = params[:plist_template_path]
73
76
  html_template_path = params[:html_template_path]
74
77
  html_file_name = params[:html_file_name]
@@ -81,7 +84,7 @@ module Fastlane
81
84
  ipa_file_name = "#{url_part}#{ipa_file_basename}"
82
85
  ipa_file_data = File.open(ipa_file, 'rb')
83
86
 
84
- ipa_url = self.upload_file(s3_client, s3_bucket, ipa_file_name, ipa_file_data, acl)
87
+ ipa_url = self.upload_file(s3_client, s3_bucket, app_directory, ipa_file_name, ipa_file_data, acl)
85
88
 
86
89
  # Setting action and environment variables
87
90
  Actions.lane_context[SharedValues::S3_IPA_OUTPUT_PATH] = ipa_url
@@ -92,7 +95,7 @@ module Fastlane
92
95
  dsym_file_name = "#{url_part}#{dsym_file_basename}"
93
96
  dsym_file_data = File.open(dsym_file, 'rb')
94
97
 
95
- dsym_url = self.upload_file(s3_client, s3_bucket, dsym_file_name, dsym_file_data, acl)
98
+ dsym_url = self.upload_file(s3_client, s3_bucket, app_directory, dsym_file_name, dsym_file_data, acl)
96
99
 
97
100
  # Setting action and environment variables
98
101
  Actions.lane_context[SharedValues::S3_DSYM_OUTPUT_PATH] = dsym_url
@@ -151,7 +154,7 @@ module Fastlane
151
154
  # plist uploading
152
155
  #
153
156
  #####################################
154
- plist_url = self.upload_file(s3_client, s3_bucket, plist_file_name, plist_render, acl)
157
+ plist_url = self.upload_file(s3_client, s3_bucket, app_directory, plist_file_name, plist_render, acl)
155
158
 
156
159
  # Creates html from template
157
160
  if html_template_path && File.exist?(html_template_path)
@@ -189,8 +192,8 @@ module Fastlane
189
192
  # html uploading
190
193
  #
191
194
  #####################################
192
- html_url = self.upload_file(s3_client, s3_bucket, html_file_name, html_render, acl)
193
- version_url = self.upload_file(s3_client, s3_bucket, version_file_name, version_render, acl)
195
+ html_url = self.upload_file(s3_client, s3_bucket, app_directory, html_file_name, html_render, acl)
196
+ version_url = self.upload_file(s3_client, s3_bucket, app_directory, version_file_name, version_render, acl)
194
197
 
195
198
  # Setting action and environment variables
196
199
  Actions.lane_context[SharedValues::S3_PLIST_OUTPUT_PATH] = plist_url
@@ -203,6 +206,7 @@ module Fastlane
203
206
  ENV[SharedValues::S3_VERSION_OUTPUT_PATH.to_s] = version_url
204
207
 
205
208
  UI.success("Successfully uploaded ipa file to '#{Actions.lane_context[SharedValues::S3_IPA_OUTPUT_PATH]}'")
209
+ UI.success("iOS app can be downloaded at '#{Actions.lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}'")
206
210
  end
207
211
 
208
212
  def self.upload_apk(s3_client, params, s3_region, s3_access_key, s3_secret_access_key, s3_bucket, apk_file, s3_path, acl)
@@ -214,6 +218,8 @@ module Fastlane
214
218
 
215
219
  s3_path = "#{version_code}_#{version_name}/" unless s3_path
216
220
 
221
+ app_directory = params[:app_directory]
222
+
217
223
  html_template_path = params[:html_template_path]
218
224
  html_file_name = params[:html_file_name]
219
225
  version_template_path = params[:version_template_path]
@@ -225,7 +231,7 @@ module Fastlane
225
231
  apk_file_name = "#{url_part}#{apk_file_basename}"
226
232
  apk_file_data = File.open(apk_file, 'rb')
227
233
 
228
- apk_url = self.upload_file(s3_client, s3_bucket, apk_file_name, apk_file_data, acl)
234
+ apk_url = self.upload_file(s3_client, s3_bucket, app_directory, apk_file_name, apk_file_data, acl)
229
235
 
230
236
  # Setting action and environment variables
231
237
  Actions.lane_context[SharedValues::S3_APK_OUTPUT_PATH] = apk_url
@@ -280,8 +286,8 @@ module Fastlane
280
286
  #
281
287
  #####################################
282
288
 
283
- html_url = self.upload_file(s3_client, s3_bucket, html_file_name, html_render, acl)
284
- version_url = self.upload_file(s3_client, s3_bucket, version_file_name, version_render, acl)
289
+ html_url = self.upload_file(s3_client, s3_bucket, app_directory, html_file_name, html_render, acl)
290
+ version_url = self.upload_file(s3_client, s3_bucket, app_directory, version_file_name, version_render, acl)
285
291
 
286
292
  Actions.lane_context[SharedValues::S3_HTML_OUTPUT_PATH] = html_url
287
293
  ENV[SharedValues::S3_HTML_OUTPUT_PATH.to_s] = html_url
@@ -290,6 +296,7 @@ module Fastlane
290
296
  ENV[SharedValues::S3_VERSION_OUTPUT_PATH.to_s] = version_url
291
297
 
292
298
  UI.success("Successfully uploaded apk file to '#{Actions.lane_context[SharedValues::S3_APK_OUTPUT_PATH]}'")
299
+ UI.success("Android app can be downloaded at '#{Actions.lane_context[SharedValues::S3_HTML_OUTPUT_PATH]}'")
293
300
  end
294
301
 
295
302
  def self.get_apk_version(apk_file)
@@ -330,7 +337,12 @@ module Fastlane
330
337
  [versionCode, versionName, name]
331
338
  end
332
339
 
333
- def self.upload_file(s3_client, bucket_name, file_name, file_data, acl)
340
+ def self.upload_file(s3_client, bucket_name, app_directory, file_name, file_data, acl)
341
+
342
+ if app_directory
343
+ file_name = "#{app_directory}/#{file_name}"
344
+ end
345
+
334
346
  bucket = Aws::S3::Bucket.new(bucket_name, client: s3_client)
335
347
  obj = bucket.put_object({
336
348
  acl: acl,
@@ -435,11 +447,15 @@ module Fastlane
435
447
  description: "AWS bucket name",
436
448
  optional: true,
437
449
  default_value: ENV['AWS_BUCKET_NAME']),
438
- FastlaneCore::ConfigItem.new(key: :region,
450
+ FastlaneCore::ConfigItem.new(key: :region,
439
451
  env_name: "S3_REGION",
440
452
  description: "AWS region (for bucket creation) ",
441
453
  optional: true,
442
454
  default_value: ENV['AWS_REGION']),
455
+ FastlaneCore::ConfigItem.new(key: :app_directory,
456
+ env_name: "S3_BUCKET_APP_DIRECTORY",
457
+ description: "Directory in bucket for the app",
458
+ optional: true),
443
459
  FastlaneCore::ConfigItem.new(key: :path,
444
460
  env_name: "S3_PATH",
445
461
  description: "S3 'path'. Values from Info.plist will be substituded for keys wrapped in {} ",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AwsS3
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-aws_s3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Holtz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk