s3_website 2.6.0 → 2.6.1
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 +4 -4
- data/README.md +1 -0
- data/changelog.md +6 -0
- data/lib/s3_website/version.rb +1 -1
- data/resources/s3_website.jar.md5 +1 -1
- data/src/main/scala/s3/website/CloudFront.scala +7 -4
- data/src/test/scala/s3/website/S3WebsiteSpec.scala +12 -1
- 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: c6bd443ae587cab4726f6ed2e3f11051bb62f7c4
|
4
|
+
data.tar.gz: 4e7410d745fc3a59f26fdc83c16d182a0ba9396f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6672d992af55beb7954846d8b47652d6c3918ab71616a68b54b4559a59705957572a99d87b364d15f92c81202401173608f26b35acc54f03d8711d0d60358e3e
|
7
|
+
data.tar.gz: 4c2fed94893a54a957f895c3ca57d54f02de2517437a564cccf90320fb18ee7349b9dd37b84e9b1e308e67fe672d7b16f91e879cc2ab221ece55af3e947c040d
|
data/README.md
CHANGED
data/changelog.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 2.6.1
|
6
|
+
|
7
|
+
* Always invalidate the object */index.html* if the setting `cloudfront_invalidate_root` is on
|
8
|
+
|
9
|
+
See https://github.com/laurilehmijoki/s3_website/pull/130 for discussion
|
10
|
+
|
5
11
|
## 2.6.0
|
6
12
|
|
7
13
|
* Support `--config-dir` in `cfg apply`
|
data/lib/s3_website/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
7a47d1df31ffe3bb8093719149222afd
|
@@ -66,7 +66,7 @@ object CloudFront {
|
|
66
66
|
}
|
67
67
|
|
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
71
|
val invalidationPaths: Seq[String] = {
|
72
72
|
def withDefaultPathIfNeeded(paths: Seq[String]) = {
|
@@ -81,11 +81,14 @@ object CloudFront {
|
|
81
81
|
)
|
82
82
|
if (containsPotentialDefaultRootObject) paths :+ "/" else paths
|
83
83
|
}
|
84
|
+
def withIndexPathIfNeeded(paths: Seq[String]) = {
|
85
|
+
if (config.cloudfront_invalidate_root.contains(true)) paths :+ "/index.html" else paths
|
86
|
+
}
|
84
87
|
val paths = pushSuccessReports
|
85
88
|
.filter(needsInvalidation) // Assume that redirect objects are never cached.
|
86
89
|
.map(toInvalidationPath)
|
87
|
-
.map
|
88
|
-
withDefaultPathIfNeeded(paths)
|
90
|
+
.map(applyInvalidateRootSetting)
|
91
|
+
withIndexPathIfNeeded(withDefaultPathIfNeeded(paths))
|
89
92
|
}
|
90
93
|
|
91
94
|
invalidationPaths
|
@@ -99,7 +102,7 @@ object CloudFront {
|
|
99
102
|
}
|
100
103
|
|
101
104
|
def applyInvalidateRootSetting(path: String)(implicit config: Config) =
|
102
|
-
if (config.cloudfront_invalidate_root.
|
105
|
+
if (config.cloudfront_invalidate_root.contains(true))
|
103
106
|
path.replaceFirst("/index.html$", "/")
|
104
107
|
else
|
105
108
|
path
|
@@ -215,7 +215,18 @@ class S3WebsiteSpec extends Specification {
|
|
215
215
|
setLocalFile("articles/index.html")
|
216
216
|
setOutdatedS3Keys("articles/index.html")
|
217
217
|
push
|
218
|
-
sentInvalidationRequest.getInvalidationBatch.getPaths.getItems.toSeq
|
218
|
+
sentInvalidationRequest.getInvalidationBatch.getPaths.getItems.toSeq must contain("/articles/")
|
219
|
+
}
|
220
|
+
|
221
|
+
"always invalidate the root path" in new BasicSetup {
|
222
|
+
config = """
|
223
|
+
|cloudfront_distribution_id: EGM1J2JJX9Z
|
224
|
+
|cloudfront_invalidate_root: true
|
225
|
+
""".stripMargin
|
226
|
+
setLocalFile("articles/index.html")
|
227
|
+
setOutdatedS3Keys("articles/index.html")
|
228
|
+
push
|
229
|
+
sentInvalidationRequest.getInvalidationBatch.getPaths.getItems.toSeq must contain("/index.html")
|
219
230
|
}
|
220
231
|
}
|
221
232
|
|
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.6.
|
4
|
+
version: 2.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|