Use prepared model and scripts if exist
Change-Id: I9186ad365f5f3f330a11930fecd0e18fd7465ae0
diff --git a/mirror-image/run.example.sh b/mirror-image/run.example.sh
index 8a51c73..a27455a 100755
--- a/mirror-image/run.example.sh
+++ b/mirror-image/run.example.sh
@@ -15,7 +15,7 @@
export IMAGE_NAME="mcp-offline-mirror-$(date '+%Y-%m-%d-%H-%M-%S')"
export PACKER_IMAGES_CACHE="${HOME}/packer_images_cache/"
#
-export CLUSTER_MODEL="https://github.com/Mirantis/mcp-offline-model.git"
+export CLUSTER_MODEL="https://gerrit.mcp.mirantis.com/mcp/mcp-offline-model"
export CLUSTER_MODEL_REF="master"
export CLUSTER_NAME="mcp-offline"
@@ -29,7 +29,7 @@
export APT_MIRANTIS_GPG="http://apt.mirantis.com/public.gpg"
export APT_MIRANTIS_SALT_REPO="http://apt.mirantis.com/xenial/ ${BINARY_MCP_VERSION} salt "
#
-export GIT_SALT_FORMULAS_SCRIPTS="https://github.com/salt-formulas/salt-formulas-scripts.git"
+export GIT_SALT_FORMULAS_SCRIPTS="https://gerrit.mcp.mirantis.com/salt-formulas/salt-formulas-scripts"
export SCRIPTS_REF="master"
#
export APT_REPOSITORY=" deb [arch=amd64] ${APT_MIRANTIS_SALT_REPO} "
@@ -50,20 +50,22 @@
export PACKER_LOG=1
pushd config-drive
- [ -d model ] && rm -rf model
- git clone ${CLUSTER_MODEL} model/
- pushd model
- git fetch ${CLUSTER_MODEL} ${CLUSTER_MODEL_REF} && git checkout FETCH_HEAD
- pushd classes/system
- git submodule init
- git submodule update
+ if [ ! -e model ]; then
+ git clone ${CLUSTER_MODEL} model/
+ pushd model
+ git fetch ${CLUSTER_MODEL} ${CLUSTER_MODEL_REF} && git checkout FETCH_HEAD
+ pushd classes/system
+ git submodule init
+ git submodule update
+ popd
popd
- popd
- [ -d salt_scripts ] && rm -rf salt_scripts
- git clone ${GIT_SALT_FORMULAS_SCRIPTS} salt_scripts/
- pushd salt_scripts
+ fi
+ if [ ! -e salt_scripts ]; then
+ git clone ${GIT_SALT_FORMULAS_SCRIPTS} salt_scripts/
+ pushd salt_scripts
git fetch ${GIT_SALT_FORMULAS_SCRIPTS} ${SCRIPTS_REF} && git checkout FETCH_HEAD
- popd
+ popd
+ fi
popd
[ -f config-drive/cloudata.iso ] && rm -v config-drive/cloudata.iso