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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6dec2f3091bddd92472b85e2baaf3ce226674a00
4
- data.tar.gz: 8f71d51ea20ef0c95d1ff19fd6fc92a3db04a63c
3
+ metadata.gz: ed60d795c8498eaa376cf3db07a1d150e664fb94
4
+ data.tar.gz: eb092f1524a34883201452b5ed013a864901d866
5
5
  SHA512:
6
- metadata.gz: 4235de618b6457b7aed3a44bc4675a7c1669b1b95b0cfe406977602bcf144df7d5e2e134af52e68f928666fc03760e99c1bcbd6484f7a60aa370cc5a52f05650
7
- data.tar.gz: 7781edee58ccbe08c88c5b57a57ca45adfa6a0361ab19f51c354dc6382307019700d8375d7d2d05510d983ce590593be810689f34459fddcb943ca56cd93c574
6
+ metadata.gz: 08ec5fdda103891fef1dd85b5319cd5572fd021048cceb1aae4fee438800462e072b6bcac45408fa8110f8dc59845cc98ed9eaa42a0229d0eec2ce8936dcd806
7
+ data.tar.gz: aab6bd5d66dafc38a200756c26a5da9e5334a35ec26f2947c1db1f6fc08dd91ed3054afc86057e126136adb63da34d673ee9dbe05da20f23ffeb06812909e3d7
data/.travis.yml CHANGED
@@ -2,6 +2,4 @@ language: scala
2
2
  scala:
3
3
  2.11.2
4
4
  jdk:
5
- - openjdk6
6
- - openjdk7
7
5
  - oraclejdk8
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/)
@@ -26,7 +26,7 @@ Here is the IAM Policy Document of the above setup:
26
26
 
27
27
  ```json
28
28
  {
29
- "Version": "2008-10-17",
29
+ "Version":"2012-10-17",
30
30
  "Statement": [
31
31
  {
32
32
  "Action": [
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
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.13.0'
2
+ VERSION = '2.14.0'
3
3
  end
@@ -43,6 +43,8 @@ s3_bucket: your.blog.bucket.com
43
43
 
44
44
  # cloudfront_invalidate_root: true
45
45
 
46
+ cloudfront_wildcard_invalidation: true
47
+
46
48
  # concurrency_level: 5
47
49
 
48
50
  # redirects:
@@ -1 +1 @@
1
- e92233dd53c6a57ba3af62377698e206
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: 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,
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.13.0
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-04-04 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor