s3_website 2.13.0 → 2.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +0 -2
- data/README.md +19 -0
- data/additional-docs/setting-up-aws-credentials.md +1 -1
- data/changelog.md +6 -0
- data/lib/s3_website/version.rb +1 -1
- data/resources/configuration_file_template.yml +2 -0
- data/resources/s3_website.jar.md5 +1 -1
- data/src/main/scala/s3/website/CloudFront.scala +5 -2
- data/src/main/scala/s3/website/model/Config.scala +18 -17
- data/src/main/scala/s3/website/model/Site.scala +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed60d795c8498eaa376cf3db07a1d150e664fb94
|
4
|
+
data.tar.gz: eb092f1524a34883201452b5ed013a864901d866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08ec5fdda103891fef1dd85b5319cd5572fd021048cceb1aae4fee438800462e072b6bcac45408fa8110f8dc59845cc98ed9eaa42a0229d0eec2ce8936dcd806
|
7
|
+
data.tar.gz: aab6bd5d66dafc38a200756c26a5da9e5334a35ec26f2947c1db1f6fc08dd91ed3054afc86057e126136adb63da34d673ee9dbe05da20f23ffeb06812909e3d7
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -277,6 +277,16 @@ cloudfront_distribution_config:
|
|
277
277
|
Once you've saved the configuration into `s3_website.yml`, you can apply them by
|
278
278
|
running `s3_website cfg apply`.
|
279
279
|
|
280
|
+
#### Invalidating all CloudFront resources (wildcard invalidation)
|
281
|
+
|
282
|
+
The following setting is recommended for most users:
|
283
|
+
|
284
|
+
```yaml
|
285
|
+
cloudfront_wildcard_invalidation: true
|
286
|
+
```
|
287
|
+
|
288
|
+
Over time, it can reduce your AWS bill significantly. For more information, see <http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html>.
|
289
|
+
|
280
290
|
#### Invalidating root resources instead of index.htmls
|
281
291
|
|
282
292
|
By default, `s3_website push` calls the CloudFront invalidation API with the
|
@@ -476,6 +486,11 @@ If you are not sure how to test your pull request, you can ask the [gem owners
|
|
476
486
|
However, by including proper tests, you increase the chances of your pull
|
477
487
|
request being incorporated into future releases.
|
478
488
|
|
489
|
+
## Alternatives
|
490
|
+
|
491
|
+
* <https://pages.github.com/>
|
492
|
+
* <https://pages.gitlab.io/>
|
493
|
+
|
479
494
|
## License
|
480
495
|
|
481
496
|
MIT. See the LICENSE file for more information.
|
@@ -524,6 +539,10 @@ Contributors (in alphabetical order)
|
|
524
539
|
* Trevor Fitzgerald
|
525
540
|
* Zee Spencer
|
526
541
|
|
542
|
+
## Community articles
|
543
|
+
|
544
|
+
* [Deploying websites to FTP or Amazon S3 with BitBucket Pipelines](https://www.savjee.be/2016/06/Deploying-website-to-ftp-or-amazon-s3-with-BitBucket-Pipelines/)
|
545
|
+
|
527
546
|
## Donations
|
528
547
|
|
529
548
|
[![Support via Gittip](https://rawgithub.com/twolfson/gittip-badge/0.2.0/dist/gittip.png)](https://www.gittip.com/laurilehmijoki/)
|
data/changelog.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 2.14.0
|
6
|
+
|
7
|
+
* Add support for CloudFront wildcard invalidations
|
8
|
+
|
9
|
+
Introduced a new setting, `cloudfront_wildcard_invalidation: (true|false)`
|
10
|
+
|
5
11
|
## 2.13.0
|
6
12
|
|
7
13
|
* Add support for `dnf`, a Linux package manager
|
data/lib/s3_website/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
6736177c885c454c20caadf2396980f0
|
@@ -68,6 +68,10 @@ object CloudFront {
|
|
68
68
|
def awsCloudFrontClient(config: Config) = new AmazonCloudFrontClient(awsCredentials(config))
|
69
69
|
|
70
70
|
def toInvalidationBatches(pushSuccessReports: Seq[PushSuccessReport])(implicit config: Config): Seq[InvalidationBatch] = {
|
71
|
+
def callerReference = s"s3_website gem ${System.currentTimeMillis()}"
|
72
|
+
if (config.cloudfront_wildcard_invalidation.contains(true) && pushSuccessReports.exists(needsInvalidation)) {
|
73
|
+
return Seq(new InvalidationBatch withPaths(new Paths withItems "/*" withQuantity 1) withCallerReference callerReference)
|
74
|
+
}
|
71
75
|
def defaultPath(paths: Seq[String]): Option[String] = {
|
72
76
|
// This is how we support the Default Root Object @ CloudFront (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html)
|
73
77
|
// We could do this more accurately by fetching the distribution config (http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/GetConfig.html)
|
@@ -102,8 +106,7 @@ object CloudFront {
|
|
102
106
|
.grouped(1000) // CloudFront supports max 1000 invalidations in one request (http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#InvalidationLimits)
|
103
107
|
.map { batchKeys =>
|
104
108
|
new InvalidationBatch() withPaths
|
105
|
-
(new Paths() withItems batchKeys withQuantity batchKeys.size) withCallerReference
|
106
|
-
s"s3_website gem ${System.currentTimeMillis()}"
|
109
|
+
(new Paths() withItems batchKeys withQuantity batchKeys.size) withCallerReference callerReference
|
107
110
|
}
|
108
111
|
.toSeq
|
109
112
|
}
|
@@ -11,23 +11,24 @@ import s3.website._
|
|
11
11
|
import com.amazonaws.auth.{AWSCredentialsProvider, BasicAWSCredentials, DefaultAWSCredentialsProviderChain}
|
12
12
|
|
13
13
|
case class Config(
|
14
|
-
s3_id:
|
15
|
-
s3_secret:
|
16
|
-
s3_bucket:
|
17
|
-
s3_endpoint:
|
18
|
-
site:
|
19
|
-
max_age:
|
20
|
-
cache_control:
|
21
|
-
gzip:
|
22
|
-
gzip_zopfli:
|
23
|
-
s3_key_prefix:
|
24
|
-
ignore_on_server:
|
25
|
-
exclude_from_upload:
|
26
|
-
s3_reduced_redundancy:
|
27
|
-
cloudfront_distribution_id:
|
28
|
-
cloudfront_invalidate_root:
|
29
|
-
redirects:
|
30
|
-
concurrency_level:
|
14
|
+
s3_id: Option[String], // If undefined, use IAM Roles (http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-roles.html)
|
15
|
+
s3_secret: Option[String], // If undefined, use IAM Roles (http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-roles.html)
|
16
|
+
s3_bucket: String,
|
17
|
+
s3_endpoint: S3Endpoint,
|
18
|
+
site: Option[String],
|
19
|
+
max_age: Option[Either[Int, S3KeyGlob[Int]]],
|
20
|
+
cache_control: Option[Either[String, S3KeyGlob[String]]],
|
21
|
+
gzip: Option[Either[Boolean, Seq[String]]],
|
22
|
+
gzip_zopfli: Option[Boolean],
|
23
|
+
s3_key_prefix: Option[String],
|
24
|
+
ignore_on_server: Option[S3KeyRegexes],
|
25
|
+
exclude_from_upload: Option[S3KeyRegexes],
|
26
|
+
s3_reduced_redundancy: Option[Boolean],
|
27
|
+
cloudfront_distribution_id: Option[String],
|
28
|
+
cloudfront_invalidate_root: Option[Boolean],
|
29
|
+
redirects: Option[Map[S3Key, String]],
|
30
|
+
concurrency_level: Int,
|
31
|
+
cloudfront_wildcard_invalidation: Option[Boolean],
|
31
32
|
treat_zero_length_objects_as_redirects: Option[Boolean]
|
32
33
|
)
|
33
34
|
|
@@ -50,6 +50,7 @@ object Site {
|
|
50
50
|
cloudfront_distribution_id <- loadOptionalString("cloudfront_distribution_id").right
|
51
51
|
cloudfront_invalidate_root <- loadOptionalBoolean("cloudfront_invalidate_root").right
|
52
52
|
concurrency_level <- loadOptionalInt("concurrency_level").right
|
53
|
+
cloudfront_wildcard_invalidation <- loadOptionalBoolean("cloudfront_wildcard_invalidation").right
|
53
54
|
redirects <- loadRedirects(s3_key_prefix).right
|
54
55
|
treat_zero_length_objects_as_redirects <- loadOptionalBoolean("treat_zero_length_objects_as_redirects").right
|
55
56
|
} yield {
|
@@ -78,6 +79,7 @@ object Site {
|
|
78
79
|
cloudfront_invalidate_root,
|
79
80
|
redirects,
|
80
81
|
concurrency_level.fold(20)(_ max 20),
|
82
|
+
cloudfront_wildcard_invalidation,
|
81
83
|
treat_zero_length_objects_as_redirects
|
82
84
|
)
|
83
85
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: s3_website
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|