Publish only latest packages by default

Change-Id: If9e8f7cdf9a90f0001089e9bdf7bcc4991635a87
diff --git a/src/com/mirantis/mk/Aptly.groovy b/src/com/mirantis/mk/Aptly.groovy
index b7353e9..8cac735 100644
--- a/src/com/mirantis/mk/Aptly.groovy
+++ b/src/com/mirantis/mk/Aptly.groovy
@@ -98,11 +98,17 @@
 
 }
 
-def publish(server, config='/etc/aptly-publisher.yaml', recreate=false, opts='-d --timeout 600') {
+def publish(server, config='/etc/aptly-publisher.yaml', recreate=false, only_latest=true, force_overwrite=true, opts='-d --timeout 600') {
     if (recreate == true) {
         opts = "${opts} --recreate"
     }
-    sh("aptly-publisher --url ${server} -c ${config} ${opts} --force-overwrite publish")
+    if (only_latest == true) {
+        opts = "${opts} --only-latest"
+    }
+    if (force_overwrite == true) {
+        opts = "${opts} --force-overwrite"
+    }
+    sh("aptly-publisher --url ${server} -c ${config} ${opts} publish")
 }
 
 /**