[build] Output a message when can't find log file

When the build tries to start an elasticsearch instance but the start fails
if it fails to find the log file then we log a line about how we can't find
the file.
This commit is contained in:
Nik Everett 2015-11-18 10:43:01 -05:00
parent 685a0462d8
commit 22873dc952
1 changed files with 3 additions and 1 deletions

View File

@ -275,11 +275,13 @@ class ClusterFormationTasks {
File logFile = new File(home, "logs/${clusterName}.log")
if (logFile.exists()) {
logFile.eachLine { line -> logger.error(line) }
} else {
logger.error("Couldn't start elasticsearch and couldn't find ${logFile}")
}
throw new GradleException('Failed to start elasticsearch')
}
}
Task start = project.tasks.create(name: name, type: DefaultTask, dependsOn: setup)
start.doLast(elasticsearchRunner)
return start