Update MCP_SALT_REPO_UPDATES var for generate cookiecutter product job in case offline

Change-Id: Ifc463ba55475d70878ebf40a1c01bed11125a8cf
Related-Prod: PROD-32736
diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 29f03fe..e6b380d 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -116,10 +116,13 @@
     }
 
     if (gitGuessedVersion == 'release/proposed/2019.2.0') {
+        def mcpSaltRepoUpdateVar = 'deb [arch=amd64] http://mirror.mirantis.com/update/proposed/salt-formulas/xenial xenial main'
+        if (context.get('offline_deployment', 'False').toBoolean()) {
+            mcpSaltRepoUpdateVar = "deb [arch=amd64] http://${context.get('aptly_server_deploy_address')}/update/proposed/salt-formulas/xenial xenial main"
+        }
         // CFG node in 2019.2.X update has to be bootstrapped with update/proposed repository for salt formulas
         context['cloudinit_master_config'] = context.get('cloudinit_master_config', false) ?: [:]
-        context['cloudinit_master_config']['MCP_SALT_REPO_UPDATES'] = context['cloudinit_master_config'].get('MCP_SALT_REPO_UPDATES', false) ?:
-                'deb [arch=amd64] http://mirror.mirantis.com/update/proposed/salt-formulas/xenial xenial main'
+        context['cloudinit_master_config']['MCP_SALT_REPO_UPDATES'] = context['cloudinit_master_config'].get('MCP_SALT_REPO_UPDATES', false) ?: mcpSaltRepoUpdateVar
     }
 
     common.infoMsg("Using context:\n" + context)