repos moved to cloud-init
Change-Id: Ib136a637e574bc6c6160ae9124c810a4927bc333
diff --git a/config-drive/master_config.sh b/config-drive/master_config.sh
index 10699f4..3211b27 100644
--- a/config-drive/master_config.sh
+++ b/config-drive/master_config.sh
@@ -5,6 +5,12 @@
export DEPLOY_NETWORK_NETMASK=255.255.255.192
export DNS_SERVERS=8.8.8.8
export SYSTEM_URL=https://github.com/Mirantis/reclass-system-salt-model.git
+export http_proxy=
+export https_proxy=
+export PIPELINES_FROM_ISO=true
+export PIPELINE_REPO_URL=https://github.com/Mirantis
+#for cloning from aptly image use port 8088
+#export PIPELINE_REPO_URL=http://172.16.47.182:8088
rm -vf /etc/update-motd.d/52-info
echo "Configuring network interfaces"
@@ -33,17 +39,6 @@
chmod -R 644 /srv/salt/reclass/classes/cluster/*
chmod -R 644 /srv/salt/reclass/classes/system/*
-echo "updating git repos"
-cp -r /mnt/mk-pipelines/* /home/repo/mk/mk-pipelines/
-cp -r /mnt/mk-pipelines/.git* /home/repo/mk/mk-pipelines/
-cp -r /mnt/pipeline-library/* /home/repo/mcp-ci/pipeline-library/
-cp -r /mnt/pipeline-library/.git* /home/repo/mcp-ci/pipeline-library/
-chown -R git:www-data /home/repo/mk/mk-pipelines/*
-chown -R git:www-data /home/repo/mk/mk-pipelines/.git*
-chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*
-chown -R git:www-data /home/repo/mcp-ci/pipeline-library/.git*
-umount /dev/cdrom
-
echo "Configuring salt"
#service salt-master restart
envsubst < /root/minion.conf > /etc/salt/minion.d/minion.conf
@@ -59,6 +54,21 @@
find /var/lib/jenkins/jenkins.model.JenkinsLocationConfiguration.xml -type f -print0 | xargs -0 sed -i -e 's/10.167.4.15/'$SALT_MASTER_DEPLOY_IP'/g'
+echo "updating git repos"
+if [ "$PIPELINES_FROM_ISO" = true ] ; then
+ cp -r /mnt/mk-pipelines/* /home/repo/mk/mk-pipelines/
+ cp -r /mnt/pipeline-library/* /home/repo/mcp-ci/pipeline-library/
+ chown -R git:www-data /home/repo/mk/mk-pipelines/*
+ chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*
+else
+ git clone --mirror $PIPELINE_REPO_URL/mk-pipelines.git /home/repo/mk/mk-pipelines/
+ git clone --mirror $PIPELINE_REPO_URL/pipeline-library.git /home/repo/mcp-ci/pipeline-library/
+ chown -R git:www-data /home/repo/mk/mk-pipelines/*
+ chown -R git:www-data /home/repo/mcp-ci/pipeline-library/*
+fi
+
+umount /dev/cdrom
+
salt-call saltutil.refresh_pillar
salt-call saltutil.sync_all
salt-call state.sls linux.network,linux,openssh,salt