Improve archive artifacts method
- Archive report files without full path
- Remove trim, because with trim of cmd.run
output, tar has incorrect format.
Change-Id: I72091028857ddf0016feeac98597b0588eeba74e
Related-Prod: OSCORE-270
diff --git a/src/com/mirantis/mk/Test.groovy b/src/com/mirantis/mk/Test.groovy
index 703372e..e0148ee 100644
--- a/src/com/mirantis/mk/Test.groovy
+++ b/src/com/mirantis/mk/Test.groovy
@@ -111,10 +111,10 @@
def artifacts_dir = '_artifacts/'
def output_file = 'rally_reports.tar'
- salt.runSaltProcessStep(master, "${target}", 'cmd.run', ["tar -cf /root/${output_file} ${reports_dir}"])
+ salt.runSaltProcessStep(master, "${target}", 'cmd.run', ["tar -cf /root/${output_file} -C ${reports_dir} ."])
sh "mkdir -p ${artifacts_dir}"
- encoded = salt.cmdRun(master, target, "cat /root/${output_file}", true, null, false)['return'][0].values()[0].replaceAll('Salt command execution success','').trim()
+ encoded = salt.cmdRun(master, target, "cat /root/${output_file}", true, null, false)['return'][0].values()[0].replaceAll('Salt command execution success','')
writeFile file: "${artifacts_dir}${output_file}", text: encoded