s3_website_monadic 0.0.28 → 0.0.29

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7900f28823f8541d10361f8b99020be7a403bb70
4
- data.tar.gz: 2e0dad3c0abf21757fce241e11a7145f58d44cd4
3
+ metadata.gz: e67a3b50d099328d1163b4ab28bb19ab5ea70bb2
4
+ data.tar.gz: 87cb81ba31dcc20734987b90d194ea95a5d7d84a
5
5
  SHA512:
6
- metadata.gz: 38a3e67004aeeb887118d7f8bfa7f5fef076bbc1c8d72ce6d6aaf409f51ed279c6602b51240ab7532bd45bf961189d2a75c1f25949e28d782b151d7b1cea8903
7
- data.tar.gz: a1e09461dec20cec96591c7b67fe6ff4299a474e30b339972cedf49408e7629028e11ae0cb9ab5e7e67a12fdbd04f03af3f2e563ffa9a1a2ac739abd99bfa7e5
6
+ metadata.gz: dde895e0d896fca1d47dfa8bb5b2ed599f698c037ef4c3cb870cbe4cfe86603964b0eb87fed90e2d45f1253b79a59600f995653fcbe31470a95e955a5544d074
7
+ data.tar.gz: 479a0f6a3c586f26833a0fc2076bddbcc94618b2b40de911422337e874a3fa4c2018be98662e19571dfa81fab508776e9333f888b455a9eac66962d42218fbc4
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '0.0.28'
2
+ VERSION = '0.0.29'
3
3
  end
@@ -105,10 +105,8 @@ object Push {
105
105
 
106
106
  def afterPushFinished(errorsOrFinishedUploads: Either[ErrorReport, FinishedPushOperations], invalidationSucceeded: Option[Boolean])
107
107
  (implicit config: Config, logger: Logger, pushMode: PushMode): ExitCode = {
108
- errorsOrFinishedUploads.right.foreach { finishedUploads =>
109
- val pushCounts = pushCountsToString(resolvePushCounts(finishedUploads))
110
- logger.info(s"Summary: $pushCounts")
111
- }
108
+ val pushCountsOption = errorsOrFinishedUploads.right.map(resolvePushCounts(_)).right.toOption
109
+ pushCountsOption.map(pushCountsToString).foreach(pushCounts => logger.info(s"Summary: $pushCounts"))
112
110
  errorsOrFinishedUploads.left foreach (err => logger.fail(s"Encountered an error: ${err.reportMessage}"))
113
111
  val exitCode = errorsOrFinishedUploads.fold(
114
112
  _ => 1,
@@ -124,7 +122,7 @@ object Push {
124
122
  )
125
123
 
126
124
  exitCode match {
127
- case 0 if !pushMode.dryRun =>
125
+ case 0 if !pushMode.dryRun && pushCountsOption.exists(_.thereWasSomethingToPush) =>
128
126
  logger.info(s"Successfully pushed the website to http://${config.s3_bucket}.${config.s3_endpoint.s3WebsiteHostname}")
129
127
  case 1 =>
130
128
  logger.fail(s"Failed to push the website to http://${config.s3_bucket}.${config.s3_endpoint.s3WebsiteHostname}")
@@ -176,7 +174,9 @@ object Push {
176
174
  failures: Int = 0,
177
175
  redirects: Int = 0,
178
176
  deletes: Int = 0
179
- )
177
+ ) {
178
+ val thereWasSomethingToPush = updates + newFiles + redirects + deletes > 0
179
+ }
180
180
  type FinishedPushOperations = ParSeq[Either[ErrorReport, PushErrorOrSuccess]]
181
181
  type PushReports = ParSeq[Either[ErrorReport, Future[PushErrorOrSuccess]]]
182
182
  case class PushResult(threadPool: ExecutorService, uploadReports: PushReports)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website_monadic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.28
4
+ version: 0.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki