in app/data/PackageList.scala [35:57]
def getPackageList(
s3Client: AmazonS3,
bakeId: BakeId,
bucket: Option[String]
): Either[String, List[String]] = {
val maybePackageList: Option[Either[String, List[String]]] = bucket.map {
b =>
val packageListKey = s3Path(bakeId)
try {
val list = s3Client.getObjectAsString(b, packageListKey)
Right(removeNonPackageLines(list.split("\n").toList))
} catch {
case NonFatal(e) =>
val message =
s"Failed to fetch package list from S3 bucket $bucket, key $packageListKey. Has the bake finished?"
log.warn(message, e)
Left(message)
}
}
maybePackageList.getOrElse(
Left("Amigo data bucket not defined: can't fetch package list")
)
}