fastlane-plugin-deploy_aws_s3_cloudfront 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: dcfef5e57f88fe7192ff1c5b1c837fd8ea0f48be0dabdf0b980564fe71877c14
|
4
|
+
data.tar.gz: 853b65d48b0e399f2db34920b5d0f38463c9ab9887dac88ee9e9c374aec3d037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 901cc74bdee6a1162af8f43d82cb72641c7e0bbc6871f663a51d1594ec25eab24d3906c0ce33e246fb4a3eab02605d4878200b3cd904bf072e895ef871d237dc
|
7
|
+
data.tar.gz: ff2e49425c2c66fec416a7cb87572dd1c048d17f6187a93b30cbf5b12021a33ae8b271b5bafe602491466fb992ce8b0ee78b011be31e6daf73a1f53668f9d621
|
data/README.md
CHANGED
@@ -12,16 +12,13 @@ fastlane add_plugin deploy_aws_s3_cloudfront
|
|
12
12
|
|
13
13
|
## About deploy_aws_s3_cloudfront
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
15
|
+
Syncs a local directory to an AWS S3 bucket and invalidate CloudFront distribution.
|
16
|
+
This plugin is based in the [deploy-aws-s3-cloudfront](https://www.npmjs.com/package/deploy-aws-s3-cloudfront) project.
|
18
17
|
|
19
18
|
## Example
|
20
19
|
|
21
20
|
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
21
|
|
23
|
-
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
-
|
25
22
|
## Run tests for this plugin
|
26
23
|
|
27
24
|
To run both the tests, and code style validation, run
|
data/lib/fastlane/plugin/deploy_aws_s3_cloudfront/actions/deploy_aws_s3_cloudfront_action.rb
CHANGED
@@ -17,12 +17,12 @@ module Fastlane
|
|
17
17
|
|
18
18
|
files = get_files_from_source(source)
|
19
19
|
|
20
|
-
paths = files.map
|
20
|
+
paths = files.map do |file|
|
21
21
|
key = file.relative_path_from(Pathname(source)).to_s
|
22
22
|
content_type = get_content_type(file)
|
23
|
-
s3client.put_object({body: file.open("rb"), bucket: bucket, key: key.to_s, content_type: content_type})
|
23
|
+
s3client.put_object({ body: file.open("rb"), bucket: bucket, key: key.to_s, content_type: content_type })
|
24
24
|
"/" + key
|
25
|
-
|
25
|
+
end
|
26
26
|
|
27
27
|
cloudfront = Aws::CloudFront::Client.new
|
28
28
|
|
@@ -31,18 +31,17 @@ module Fastlane
|
|
31
31
|
invalidation_batch: {
|
32
32
|
paths: {
|
33
33
|
quantity: paths.size,
|
34
|
-
items: paths
|
34
|
+
items: paths
|
35
35
|
},
|
36
36
|
caller_reference: SecureRandom.hex
|
37
|
-
}
|
37
|
+
}
|
38
38
|
}
|
39
39
|
|
40
40
|
cloudfront.create_invalidation(invalidation)
|
41
|
-
|
42
41
|
end
|
43
42
|
|
44
43
|
def self.get_files_from_source(source)
|
45
|
-
return Dir.glob("#{source}/**/*").select {|f| File.file?
|
44
|
+
return Dir.glob("#{source}/**/*").select { |f| File.file?(f) }.map { |f| Pathname(f) }
|
46
45
|
end
|
47
46
|
|
48
47
|
def self.get_content_type(file)
|
@@ -70,21 +69,21 @@ module Fastlane
|
|
70
69
|
|
71
70
|
def self.available_options
|
72
71
|
[
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
72
|
+
FastlaneCore::ConfigItem.new(key: :bucket,
|
73
|
+
env_name: "DEPLOY_AWS_S3_CLOUDFRONT_YOUR_OPTION",
|
74
|
+
description: "A description of your option",
|
75
|
+
optional: false,
|
76
|
+
type: String),
|
77
|
+
FastlaneCore::ConfigItem.new(key: :source,
|
78
|
+
env_name: "DEPLOY_AWS_S3_CLOUDFRONT_YOUR_OPTION",
|
79
|
+
description: "A description of your option",
|
80
|
+
optional: false,
|
81
|
+
type: String),
|
82
|
+
FastlaneCore::ConfigItem.new(key: :distribution_id,
|
83
|
+
env_name: "DEPLOY_AWS_S3_CLOUDFRONT_YOUR_OPTION",
|
84
|
+
description: "A description of your option",
|
85
|
+
optional: false,
|
86
|
+
type: String)
|
88
87
|
]
|
89
88
|
end
|
90
89
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-deploy_aws_s3_cloudfront
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hector
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-s3
|
@@ -209,8 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
209
|
- !ruby/object:Gem::Version
|
210
210
|
version: '0'
|
211
211
|
requirements: []
|
212
|
-
|
213
|
-
rubygems_version: 2.5.2.3
|
212
|
+
rubygems_version: 3.0.3
|
214
213
|
signing_key:
|
215
214
|
specification_version: 4
|
216
215
|
summary: Deploy local directory to AWS S3 bucket and invalidate CloudFront
|