Skip to content

Commit

Permalink
Fix NoSuchFileException cause by PREFIX directory does not created.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohei TSUJI committed Jan 17, 2017
1 parent 28c1a9c commit 5d291f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
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.2.0",
version := "0.2.1-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 @@ -18,6 +18,7 @@ class S3SourceFlywayDeployer(s3Client: AmazonS3, srcBucketName: String, srcPrefi
val logger = context.getLogger

val tmpDir = Files.createDirectories(Paths.get("/tmp", context.getAwsRequestId))
Files.createDirectories(Paths.get(tmpDir.toString, srcPrefix))

@tailrec
def deployInternal(objects: List[S3ObjectSummary], acc: (Option[JProperties], ListBuffer[Path])): (Option[JProperties], Seq[Path]) = {
Expand Down Expand Up @@ -61,6 +62,9 @@ class S3SourceFlywayDeployer(s3Client: AmazonS3, srcBucketName: String, srcPrefi
x.getKey.compareTo(y.getKey) < 1
}
}

logger.log(s"Deploying Flyway resources from $srcBucketName/$srcPrefix... ${objectSummaries.map(_.getKey).mkString(", ")}")

deployInternal(objectSummaries, (None, ListBuffer())) match {
case (Some(conf), sqlFiles) =>
FlywayDeployment(
Expand Down

0 comments on commit 5d291f2

Please sign in to comment.