Skip to content

Commit

Permalink
Merge pull request #615 from marcusholl/pr/avoidHavingNeoLogFolderStr…
Browse files Browse the repository at this point in the history
…ingLiteralThreeTimes

Avoid having the same string literal for the neo log folder three times
  • Loading branch information
marcusholl authored May 27, 2019
2 parents a8648a4 + 6a55188 commit 7dee57d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vars/neoDeploy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,11 @@ void call(parameters = [:]) {

private deploy(script, utils, Map configuration, NeoCommandHelper neoCommandHelper, dockerImage, DeployMode deployMode) {

String logFolder = 'logs/neo'

try {
sh "mkdir -p logs/neo"
withEnv(["neo_logging_location=${pwd()}/logs/neo"]) {
sh "mkdir -p ${logFolder}"
withEnv(["neo_logging_location=${pwd()}/${logFolder}"]) {
if (deployMode.isWarDeployment()) {
ConfigurationHelper.newInstance(this, configuration).withPropertyInValues('warAction', WarAction.stringValues())
WarAction warAction = WarAction.fromString(configuration.warAction)
Expand Down Expand Up @@ -261,7 +263,7 @@ private deploy(script, utils, Map configuration, NeoCommandHelper neoCommandHelp

echo "Error while deploying to SAP Cloud Platform. Here are the neo.sh logs:"
try {
sh "cat logs/neo/*"
sh "cat ${logFolder}/*"
} catch(Exception e) {
echo "Unable to provide the logs."
ex.addSuppressed(e)
Expand Down

0 comments on commit 7dee57d

Please sign in to comment.