diff --git a/update-mirror-image.groovy b/update-mirror-image.groovy
index e37d537..2f71d2a 100644
--- a/update-mirror-image.groovy
+++ b/update-mirror-image.groovy
@@ -1,37 +1,62 @@
 /**
- * Update mirror image
+ * Update local mirror
  *
  * Expected parameters:
  *   SALT_MASTER_CREDENTIALS            Credentials to the Salt API.
- *   SALT_MASTER_URL                    Full Salt API address [https://10.10.10.1:8000].
+ *   SALT_MASTER_URL                    Full Salt API address [https://10.10.10.1:6969].
  *   UPDATE_APTLY                       Option to update Aptly
  *   UPDATE_APTLY_MIRRORS               List of mirrors
  *   PUBLISH_APTLY                      Publish aptly snapshots
+ *   RECREATE_APTLY_MIRRORS             Recreate Aptly mirrors
  *   RECREATE_APTLY_PUBLISHES           Option to recreate Aptly publishes separated by comma
  *   FORCE_OVERWRITE_APTLY_PUBLISHES    Option to force overwrite existing packages while publishing
  *   CLEANUP_APTLY                      Option to cleanup old Aptly snapshots
+ *   UPDATE_DEBMIRRORS                  Option to update Debmirrors
  *   UPDATE_DOCKER_REGISTRY             Option to update Docker Registry
  *   CLEANUP_DOCKER_CACHE               Option to cleanup locally cached Docker images
- *   UPDATE_PYPI                        Option to update Python Packages
  *   UPDATE_GIT                         Option to update Git repositories
- *   UPDATE_IMAGES                      Option to update VM images
+ *   UPDATE_FILES                       Option to update static files
  *
 **/
 
-def common = new com.mirantis.mk.Common()
-def salt = new com.mirantis.mk.Salt()
-def python = new com.mirantis.mk.Python()
-def venvPepper = "venvPepper"
+common = new com.mirantis.mk.Common()
+salt = new com.mirantis.mk.Salt()
+python = new com.mirantis.mk.Python()
+venvPepper = "venvPepper"
+
+@NonCPS
+def Boolean dockerExists() {
+  def engine = salt.getPillar(venvPepper, 'I@aptly:server', "aptly:server:source:engine")
+  def matches = (engine =~ /:docker/)
+  try{
+      def test = matches[position]
+      return false
+  }catch(Exception ex){
+      return true
+  }
+}
+
 timeout(time: 12, unit: 'HOURS') {
     node() {
         try {
             python.setupPepperVirtualenv(venvPepper, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+            def dockerExists = dockerExists()
 
             if(UPDATE_APTLY.toBoolean()){
                 stage('Update Aptly mirrors'){
                     def aptlyMirrorArgs = "-s -v"
 
-                    salt.enforceState(venvPepper, '*apt*', ['aptly.server'], true)
+                    if(RECREATE_APTLY_MIRRORS.toBoolean())
+                    {
+                        if(dockerExists){
+                            salt.cmdRun(venvPepper, 'I@aptly:server', "aptly mirror list --raw | grep -E '*' | xargs -n 1 aptly mirror drop -force", true, null, true)
+                        }
+                        else{
+                            salt.cmdRun(venvPepper, 'I@aptly:server', "aptly mirror list --raw | grep -E '*' | xargs -n 1 aptly mirror drop -force", true, null, true, ['runas=aptly'])
+                        }
+                    }
+
+                    salt.enforceState(venvPepper, 'I@aptly:server', ['aptly.server'], true)
                     sleep(10)
 
                     if(UPDATE_APTLY_MIRRORS != ""){
@@ -39,21 +64,31 @@
                         UPDATE_APTLY_MIRRORS = UPDATE_APTLY_MIRRORS.replaceAll("\\s","")
                         def mirrors = UPDATE_APTLY_MIRRORS.tokenize(",")
                         for(mirror in mirrors){
-                            salt.runSaltProcessStep(venvPepper, '*apt*', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs} -m ${mirror}\"", 'runas=aptly'], null, true)
+                            if(dockerExists){
+                                salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs} -m ${mirror}\""], null, true)
+                            }else{
+                                salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs} -m ${mirror}\"", 'runas=aptly'], null, true)
+                            }
                         }
                     }
                     else{
                         common.infoMsg("Updating all Aptly mirrors.")
-                        salt.runSaltProcessStep(venvPepper, '*apt*', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs}\"", 'runas=aptly'], null, true)
+
+                        if(dockerExists){
+                            salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs}\""], null, true)
+                        }
+                        else{
+                            salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=\"${aptlyMirrorArgs}\"", 'runas=aptly'], null, true)
+                        }
                     }
                 }
             }
             if(PUBLISH_APTLY.toBoolean()){
-                def aptlyPublishArgs = "-av"
+                def aptlyPublishArgs = "-v"
 
                 common.infoMsg("Publishing all Aptly snapshots.")
 
-                salt.enforceState(venvPepper, '*apt*', ['aptly.publisher'], true)
+                salt.enforceState(venvPepper, 'I@aptly:server', ['aptly.publisher'], true)
                 sleep(10)
 
                 if(CLEANUP_APTLY.toBoolean()){
@@ -65,33 +100,40 @@
                 if(FORCE_OVERWRITE_APTLY_PUBLISHES.toBoolean()){
                     aptlyPublishArgs += "f"
                 }
-                salt.runSaltProcessStep(venvPepper, '*apt*', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=\"${aptlyPublishArgs}\"", 'runas=aptly'], null, true)
+                if(dockerExists){
+                    aptlyPublishArgs += " -u http://10.99.0.1:8080"
+                    salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=\"${aptlyPublishArgs}\""], null, true)
+                }
+                else{
+                    aptlyPublishArgs += "a"
+                    salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=\"${aptlyPublishArgs}\"", 'runas=aptly'], null, true)
+                }
+            }
+            if(UPDATE_DEBMIRRORS.toBoolean()){
+                stage('Update Debmirrors'){
+                    common.infoMsg("Updating Debmirrors")
+                    salt.enforceState(venvPepper, 'I@debmirror:client', 'debmirror')
+                }
             }
             if(UPDATE_DOCKER_REGISTRY.toBoolean()){
                 stage('Update Docker images'){
                     common.infoMsg("Updating Docker images.")
-                    salt.enforceState(venvPepper, '*apt*', 'docker.client.registry')
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'docker.client.registry')
                     if(CLEANUP_DOCKER_CACHE.toBoolean()){
-                        salt.cmdRun(venvPepper, '*apt*', 'docker system prune --all --force')
+                        salt.cmdRun(venvPepper, 'I@aptly:server', 'docker system prune --all --force')
                     }
                 }
             }
-            if(UPDATE_PYPI.toBoolean()){
-                stage('Update PyPi packages'){
-                    common.infoMsg("Updating PyPi packages.")
-                    salt.cmdRun(venvPepper, '*apt*', 'pip2pi /srv/pypi_mirror/packages/ -r /srv/pypi_mirror/requirements.txt')
-                }
-            }
             if(UPDATE_GIT.toBoolean()){
                 stage('Update Git repositories'){
                     common.infoMsg("Updating Git repositories.")
-                    salt.enforceState(venvPepper, '*apt*', ['git.server'], true)
+                    salt.enforceState(venvPepper, 'I@aptly:server', ['git.server'], true)
                 }
             }
-            if(UPDATE_IMAGES.toBoolean()){
-                stage('Update VM images'){
-                    common.infoMsg("Updating VM images.")
-                    salt.runSaltProcessStep(venvPepper, '*apt*', '/srv/scripts/update-images.sh')
+            if(UPDATE_FILES.toBoolean()){
+                stage('Update static files'){
+                    common.infoMsg("Updating static files.")
+                    salt.enforceState(venvPepper, 'I@aptly:server', ['linux.system.file'], true)
                 }
             }
         } catch (Throwable e) {
diff --git a/upgrade-mcp-release.groovy b/upgrade-mcp-release.groovy
index d423347..70256b7 100644
--- a/upgrade-mcp-release.groovy
+++ b/upgrade-mcp-release.groovy
@@ -10,14 +10,28 @@
  */
 
 // Load shared libs
-def salt = new com.mirantis.mk.Salt()
-def common = new com.mirantis.mk.Common()
-def python = new com.mirantis.mk.Python()
-def venvPepper = "venvPepper"
+salt = new com.mirantis.mk.Salt()
+common = new com.mirantis.mk.Common()
+python = new com.mirantis.mk.Python()
+venvPepper = "venvPepper"
+
+@NonCPS
+def Boolean dockerExists() {
+  def engine = salt.getPillar(venvPepper, 'I@aptly:server', "aptly:server:source:engine")
+  def matches = (engine =~ /:docker/)
+  try{
+      def test = matches[position]
+      return false
+  }catch(Exception ex){
+      return true
+  }
+}
+
 timeout(time: 12, unit: 'HOURS') {
     node("python") {
         try {
             python.setupPepperVirtualenv(venvPepper, SALT_MASTER_URL, SALT_MASTER_CREDENTIALS)
+            def dockerExists = dockerExists()
 
             stage("Update Reclass"){
                 common.infoMsg("Updating reclass model")
@@ -29,20 +43,31 @@
             if(UPDATE_LOCAL_REPOS.toBoolean()){
                 stage("Update local repos"){
                     common.infoMsg("Updating local repositories")
-                    salt.cmdRun(venvPepper, '*apt*', "aptly mirror list --raw | grep -E '*' | xargs -n 1 aptly mirror drop -force", true, null, true, ['runas=aptly'])
-                    salt.enforceState(venvPepper, '*apt*', 'aptly', true)
-                    salt.runSaltProcessStep(venvPepper, '*apt*', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=-sv", 'runas=aptly'], null, true)
-                    salt.runSaltProcessStep(venvPepper, '*apt*', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=-afrv", 'runas=aptly'], null, true)
+                    if(dockerExists){
+                        salt.cmdRun(venvPepper, 'I@aptly:server', "aptly mirror list --raw | grep -E '*' | xargs -n 1 aptly mirror drop -force", true, null, true)
+                    }
+                    else{
+                       salt.cmdRun(venvPepper, 'I@aptly:server', "aptly mirror list --raw | grep -E '*' | xargs -n 1 aptly mirror drop -force", true, null, true, ['runas=aptly'])
+                    }
 
-                    salt.enforceState(venvPepper, '*apt*', 'docker.client.registry', true)
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'aptly', true)
 
-                    salt.cmdRun(venvPepper, '*apt*', "export HOME='/root';export MCP_VERSION='${MCP_VERSION}';/srv/scripts/debmirror.sh")
+                    if(dockerExists){
+                        salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=-sv"], null, true)
+                        salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=-frv -u http://10.99.0.1:8080"], null, true)
+                    }
+                    else{
+                        salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_mirror_update.sh', "args=-sv", 'runas=aptly'], null, true)
+                        salt.runSaltProcessStep(venvPepper, 'I@aptly:server', 'cmd.script', ['salt://aptly/files/aptly_publish_update.sh', "args=-afrv", 'runas=aptly'], null, true)
+                    }
 
-                    salt.enforceState(venvPepper, '*apt*', 'git server', true)
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'docker.client.registry', true)
 
-                    salt.cmdRun(venvPepper, '*apt*', 'pip2pi /srv/pypi_mirror/packages/ -r /srv/pypi_mirror/requirements.txt')
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'debmirror', true)
 
-                    salt.cmdRun(venvPepper, '*apt*', '/srv/scripts/update-images.sh')
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'git.server', true)
+
+                    salt.enforceState(venvPepper, 'I@aptly:server', 'linux.system.file', true)
                 }
             }
 
