Skip to content

Commit

Permalink
Merge pull request #2 from crossroad0201/issues/NoSuchFileException
Browse files Browse the repository at this point in the history
Issues/no such file exception
  • Loading branch information
crossroad0201 authored Nov 29, 2016
2 parents 5d0ed61 + f2b69ac commit 36fbd4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
lazy val flywayAwsLambda = (project in file(".")).settings(
organization := "crossroad0201.aws",
name := "flyway-awslambda",
version := "0.1.0",
version := "0.2.0-SNAPSHOT",
scalaVersion := "2.12.0",

assemblyJarName := s"${name.value}-${version.value}.jar",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ class S3EventMigrationHandler extends RequestHandler[S3Event, String] {
val objectKey = s3.getObject.getKey
objectKey.substring(0, objectKey.lastIndexOf("/"))
}
val objects = s3Client.listObjects(bucket.getName, migrationPrefix)

deployInternal(objects.getObjectSummaries.asScala.toList, (None, ListBuffer())) match {
val objectSummaries = {
val objects = s3Client.listObjects(bucket.getName, migrationPrefix)
objects.getObjectSummaries.asScala.toList.sortWith { (x, y) =>
x.getKey.compareTo(y.getKey) < 1
}
}
deployInternal(objectSummaries, (None, ListBuffer())) match {
case (Some(conf), sqlFiles) =>
FlywayDeployment(
bucket.getName,
Expand Down

0 comments on commit 36fbd4b

Please sign in to comment.