Add ability to build offline image with MU tag inside
MU tag inside will be just simple symlink to latest available MU
release and needed to be able to deploy by tag from image.
Change-Id: I73e5876a633c18dc55767bc20c5d0686fd426caf
Related-Prod: PROD-34366
diff --git a/mirror-image/scripts/mirrors.sh b/mirror-image/scripts/mirrors.sh
index 3c25e3f..8358e87 100644
--- a/mirror-image/scripts/mirrors.sh
+++ b/mirror-image/scripts/mirrors.sh
@@ -25,11 +25,23 @@
#git
salt-call ${SALT_OPTS} state.sls git.server
+
+CUR_V=$(salt-call pillar.get _param:mcp_version --out text | awk '{print $2}')
+# get tagged mcp_version for current latest MU 2019.2.x
+CUR_T=$(salt-call pillar.get _param:tagged_mcp_version --out text | awk '{print $2}')
# Enable 'update' hook.
# Those would prevent failures for 2018q3+ model releases, where
# 'system.linux.system.repo.mcp.apt_mirantis.update.xxx' enabled by default
pushd /srv/volumes/aptly/public/
- CUR_V=$(salt-call pillar.get _param:mcp_version --out text | awk '{print $2}')
mkdir -p update
ln -s ../${CUR_V} update/${CUR_V} || true
+ if [[ -n "${CUR_T}" ]]; then
+ ln -s ${CUR_V} ${CUR_T}
+ # usually should be just ln -s update/${CUR_V} update/${CUR_T} - but need to specify dir in case of proposed testing
+ UPDATE_DIR=$(salt-call pillar.get _param:debmirror_mirrors_update_target_dir --out text | awk '{print $2}')
+ ln -s ${UPDATE_DIR} update/${CUR_T}
+ fi
popd
+if [[ -n "${CUR_T}" ]]; then
+ ln -s /srv/http/${CUR_V} /srv/http/${CUR_T}
+fi