From b90b80ae4270e853b4e9509959b6e4ede364b997 Mon Sep 17 00:00:00 2001 From: Manuele Simi Date: Thu, 10 Oct 2019 12:26:56 -0400 Subject: [PATCH] Shell steps in the post-action block. --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a4868fa..4db04ee 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -98,7 +98,6 @@ pipeline { cp "${agent_root_folder}/${maven_settings_file}" "${agent_root_folder}/settings.xml" echo "Done with local repository" ''' - } } // the maven-parent needs to be built (once) at each execution @@ -197,7 +196,11 @@ pipeline { post { always { echo 'The default maven settings have been restored' - mv "${agent_root_folder}/settings.${PIPELINE_BUILD_NUMBER}" "${agent_root_folder}/settings.xml" + steps { + sh ''' + mv "${agent_root_folder}/settings.${PIPELINE_BUILD_NUMBER}" "${agent_root_folder}/settings.xml" + ''' + } } success { echo 'The pipeline worked!'