Dump publishes before promoting components

Change-Id: I833ce9b48c5b9fdeaecae8f1da3ea565a92e571a
diff --git a/src/com/mirantis/mk/Aptly.groovy b/src/com/mirantis/mk/Aptly.groovy
index f3c7931..6c2422a 100644
--- a/src/com/mirantis/mk/Aptly.groovy
+++ b/src/com/mirantis/mk/Aptly.groovy
@@ -88,11 +88,12 @@
         opts = "${opts} --dry --diff"
     }
 
-    sh("aptly-publisher --url ${server} promote --source ${source} --target ${target} --force-overwrite ${opts}")
-
     def now = new Date();
     def timestamp = now.format("yyyyMMddHHmmss", TimeZone.getTimeZone('UTC'));
     dumpPublishes(server, ".", timestamp, target)
+
+    sh("aptly-publisher --url ${server} promote --source ${source} --target ${target} --force-overwrite ${opts}")
+
 }
 
 def publish(server, config='/etc/aptly-publisher.yaml', recreate=false, opts='-d --timeout 600') {