s3_website 2.7.5 → 2.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +6 -0
- data/lib/s3_website/version.rb +1 -1
- data/src/main/scala/s3/website/Push.scala +16 -22
- data/src/main/scala/s3/website/model/push.scala +4 -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: d299d7f67b1761c67dec45101228c871af587630
|
4
|
+
data.tar.gz: f422c6066800271303d189d4a205744508ca1a63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df7b35cc68abd07816902aa2b1753436b617fc46123d56fab1bf4f023416505f839b35fb21384de059c8ff82f9e6fd9b0283750615b15f1ed2295ac1295217f3
|
7
|
+
data.tar.gz: 6686e17eaa28e15c98eb7d8528ab993fb8a545faf9440fe1e0879c5c0c7caf9063e76442cfa46488787da6d680ae7d5773e355dfff42f1ff78f7d1b9391774e8
|
data/changelog.md
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
This project uses [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## 2.7.6
|
6
|
+
|
7
|
+
* Null-check the result of File.listFiles
|
8
|
+
|
9
|
+
See <https://github.com/laurilehmijoki/s3_website/issues/145> for discussion.
|
10
|
+
|
5
11
|
## 2.7.5
|
6
12
|
|
7
13
|
* Remove superfluous dot from error message
|
data/lib/s3_website/version.rb
CHANGED
@@ -83,30 +83,24 @@ object Push {
|
|
83
83
|
): ExitCode = {
|
84
84
|
logger.info(s"${Deploy.renderVerb} ${site.rootDirectory}/* to ${site.config.s3_bucket}")
|
85
85
|
val s3FilesFuture = resolveS3Files()
|
86
|
-
val redirectsFuture
|
87
|
-
val redirectReports
|
88
|
-
|
89
|
-
|
90
|
-
}
|
86
|
+
val redirectsFuture = resolveRedirects(s3FilesFuture)
|
87
|
+
val redirectReports = redirectsFuture.map { errOrRedirects =>
|
88
|
+
errOrRedirects.right.map(_.filter(_.needsUpload).map(S3 uploadRedirect _))
|
89
|
+
}
|
91
90
|
|
92
|
-
val
|
93
|
-
|
94
|
-
errorOrUploads: Either[ErrorReport, Seq[Upload]] <- uploadFutures
|
91
|
+
val uploadReports = for {
|
92
|
+
errorOrUploads <- resolveUploads(s3FilesFuture)
|
95
93
|
} yield errorOrUploads.right.map(_.map(S3 uploadFile _))
|
96
94
|
|
97
|
-
val deleteReports
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
)
|
105
|
-
}.map { (deletes: Either[ErrorReport, Seq[S3Key]]) =>
|
106
|
-
deletes.right.map(keysToDelete => keysToDelete.map(S3 delete _))
|
107
|
-
}
|
108
|
-
Await.result(errorsOrDeleteReports, 1 day)
|
95
|
+
val deleteReports = redirectsFuture flatMap { errOrRedirects =>
|
96
|
+
errOrRedirects.fold(
|
97
|
+
err => Future(Left(err)),
|
98
|
+
redirects => resolveDeletes(s3FilesFuture, redirects)
|
99
|
+
)
|
100
|
+
} map { deletes =>
|
101
|
+
deletes.right.map(keysToDelete => keysToDelete.map(S3 delete _))
|
109
102
|
}
|
103
|
+
|
110
104
|
val allReports = Future.sequence(redirectReports :: uploadReports :: deleteReports :: Nil) map { reports =>
|
111
105
|
reports.foldLeft(Nil: PushReports) { (memo, report: Either[ErrorReport, Seq[Future[PushErrorOrSuccess]]]) =>
|
112
106
|
report match {
|
@@ -120,7 +114,7 @@ object Push {
|
|
120
114
|
val finishedPushOps = awaitForResults(Await.result(allReports, 1 day))
|
121
115
|
val invalidationSucceeded = invalidateCloudFrontItems(finishedPushOps)
|
122
116
|
|
123
|
-
|
117
|
+
report(finishedPushOps, invalidationSucceeded)
|
124
118
|
}
|
125
119
|
|
126
120
|
def invalidateCloudFrontItems
|
@@ -157,7 +151,7 @@ object Push {
|
|
157
151
|
|
158
152
|
type InvalidationSucceeded = Boolean
|
159
153
|
|
160
|
-
def
|
154
|
+
def report(finishedPushOps: FinishedPushOperations, invalidationSucceeded: Option[Boolean])
|
161
155
|
(implicit config: Config, logger: Logger, pushOptions: PushOptions): ExitCode = {
|
162
156
|
val pushCounts = resolvePushCounts(finishedPushOps)
|
163
157
|
logger.info(s"Summary: ${pushCountsToString(pushCounts)}")
|
@@ -128,7 +128,10 @@ object Upload {
|
|
128
128
|
object Files {
|
129
129
|
def recursiveListFiles(f: File): Seq[File] = {
|
130
130
|
val these = f.listFiles
|
131
|
-
these
|
131
|
+
if (these != null)
|
132
|
+
these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles)
|
133
|
+
else
|
134
|
+
Nil
|
132
135
|
}
|
133
136
|
|
134
137
|
def listSiteFiles(implicit site: Site, logger: Logger) = {
|
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.7.
|
4
|
+
version: 2.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lauri Lehmijoki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|