s3_website 2.1.12 → 2.1.13
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f58dc2a4c31a05615ccfabc88ab06787fe6d9c2
|
4
|
+
data.tar.gz: 4848ab9653a8c796ee94fbd97ec59691d9b1e17b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33d258cac936218cd84292e0111dfa5edb4dcd792cf2a81693abcb446f161bb6bd33bb2a0cba3c6496df0d573307c1f0d34e735ce40d2c360483b58478ee75e5
|
7
|
+
data.tar.gz: af4dce07242118c7d680c252a10877347bca41ddba90a595c2bb4fd22bd5b4e93bd36a0e079e3a168e1d7c1c61f566d748220b352daba7992487546e7421cf2b
|
data/changelog.md
CHANGED
data/lib/s3_website/version.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
package s3.website
|
2
2
|
|
3
|
+
import s3.website.ErrorReport._
|
3
4
|
import s3.website.model.{FileUpdate, Config}
|
4
5
|
import com.amazonaws.services.cloudfront.{AmazonCloudFrontClient, AmazonCloudFront}
|
5
6
|
import com.amazonaws.services.cloudfront.model.{TooManyInvalidationsInProgressException, Paths, InvalidationBatch, CreateInvalidationRequest}
|
@@ -60,8 +61,8 @@ object CloudFront {
|
|
60
61
|
def reportMessage = s"${Invalidated.renderVerb} ${invalidatedItemsCount ofType "item"} on CloudFront"
|
61
62
|
}
|
62
63
|
|
63
|
-
case class FailedInvalidation(error: Throwable) extends
|
64
|
-
def reportMessage = s"Failed to invalidate the CloudFront distribution
|
64
|
+
case class FailedInvalidation(error: Throwable)(implicit logger: Logger) extends ErrorReport {
|
65
|
+
def reportMessage = errorMessage(s"Failed to invalidate the CloudFront distribution", error)
|
65
66
|
}
|
66
67
|
|
67
68
|
def awsCloudFrontClient(config: Config) = new AmazonCloudFrontClient(awsCredentials(config))
|
@@ -8,7 +8,7 @@ class Logger(val verboseOutput: Boolean) {
|
|
8
8
|
def fail(msg: String) = log(Failure, msg)
|
9
9
|
|
10
10
|
def info(report: SuccessReport) = log(Success, report.reportMessage)
|
11
|
-
def info(report:
|
11
|
+
def info(report: ErrorReport) = fail(report.reportMessage)
|
12
12
|
|
13
13
|
def pending(msg: String) = log(Wait, msg)
|
14
14
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
package s3.website
|
2
2
|
|
3
|
+
import s3.website.ErrorReport.errorMessage
|
3
4
|
import s3.website.model._
|
4
5
|
import com.amazonaws.services.s3.{AmazonS3, AmazonS3Client}
|
5
6
|
import com.amazonaws.services.s3.model._
|
@@ -140,7 +141,7 @@ object S3 {
|
|
140
141
|
type UpdateFutures = Seq[Either[ErrorReport, Future[PushErrorOrSuccess]]]
|
141
142
|
type ErrorOrS3Files = Either[ErrorReport, Seq[S3File]]
|
142
143
|
|
143
|
-
sealed trait PushFailureReport extends
|
144
|
+
sealed trait PushFailureReport extends ErrorReport
|
144
145
|
sealed trait PushSuccessReport extends SuccessReport {
|
145
146
|
def s3Key: String
|
146
147
|
}
|
@@ -208,12 +209,12 @@ object S3 {
|
|
208
209
|
def reportMessage = s"${Deleted.renderVerb} $s3Key"
|
209
210
|
}
|
210
211
|
|
211
|
-
case class FailedUpload(s3Key: String, error: Throwable) extends PushFailureReport {
|
212
|
-
def reportMessage = s"Failed to upload $s3Key
|
212
|
+
case class FailedUpload(s3Key: String, error: Throwable)(implicit logger: Logger) extends PushFailureReport {
|
213
|
+
def reportMessage = errorMessage(s"Failed to upload $s3Key", error)
|
213
214
|
}
|
214
215
|
|
215
|
-
case class FailedDelete(s3Key: String, error: Throwable) extends PushFailureReport {
|
216
|
-
def reportMessage = s"Failed to delete $s3Key
|
216
|
+
case class FailedDelete(s3Key: String, error: Throwable)(implicit logger: Logger) extends PushFailureReport {
|
217
|
+
def reportMessage = errorMessage(s"Failed to delete $s3Key", error)
|
217
218
|
}
|
218
219
|
|
219
220
|
type S3ClientProvider = (Config) => AmazonS3
|
@@ -13,25 +13,27 @@ package object website {
|
|
13
13
|
}
|
14
14
|
trait SuccessReport extends Report
|
15
15
|
|
16
|
-
trait FailureReport extends Report
|
17
|
-
|
18
16
|
trait ErrorReport extends Report
|
19
17
|
|
20
18
|
object ErrorReport {
|
21
19
|
def apply(t: Throwable)(implicit logger: Logger) = new ErrorReport {
|
22
|
-
override def reportMessage =
|
23
|
-
val extendedReport =
|
24
|
-
if (logger.verboseOutput)
|
25
|
-
Some(t.getStackTrace take 5)
|
26
|
-
else
|
27
|
-
None
|
28
|
-
s"${t.getMessage}${extendedReport.fold("")(stackTraceElems => "\n" + stackTraceElems.mkString("\n"))}"
|
29
|
-
}
|
20
|
+
override def reportMessage = errorMessage(t)
|
30
21
|
}
|
31
22
|
|
32
23
|
def apply(msg: String) = new ErrorReport {
|
33
24
|
override def reportMessage = msg
|
34
25
|
}
|
26
|
+
|
27
|
+
def errorMessage(msg: String, t: Throwable)(implicit logger: Logger): String = s"$msg (${errorMessage(t)})"
|
28
|
+
|
29
|
+
def errorMessage(t: Throwable)(implicit logger: Logger): String = {
|
30
|
+
val extendedReport =
|
31
|
+
if (logger.verboseOutput)
|
32
|
+
Some(t.getStackTrace)
|
33
|
+
else
|
34
|
+
None
|
35
|
+
s"${t.getMessage}${extendedReport.fold("")(stackTraceElems => "\n" + stackTraceElems.mkString("\n"))}"
|
36
|
+
}
|
35
37
|
}
|
36
38
|
|
37
39
|
trait RetrySetting {
|
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.1.
|
4
|
+
version: 2.1.13
|
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-06-
|
11
|
+
date: 2014-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|