Mirror image - add mkdirs to debmirror.sh
Change-Id: Ibf67f3c27c367ab36fe67f1d2b14d5f88e41f5a9
diff --git a/mirror-image/debmirror.sh b/mirror-image/debmirror.sh
index 2f253ae..4bb1489 100644
--- a/mirror-image/debmirror.sh
+++ b/mirror-image/debmirror.sh
@@ -3,12 +3,16 @@
set -xe
set -o pipefail
stamp=$(date "+%Y_%m_%d_%H_%M_%S")
-DEBMLOG=/var/log/debmirror/${stamp}.log
+LOGDIR=/var/log/debmirror
+DEBMLOG=${LOGDIR}/${stamp}.log
MIRRORDIR=/srv/aptly/public
MCP_VERSION=${MCP_VERSION:-stable}
MIRROR_HOST=${MIRROR_HOST:-"mirror.mirantis.com"}
method=${CLONE_METHOD:-"rsync"}
+mkdir -p ${LOGDIR}
+mkdir -p ${MIRRORDIR}
+
if [[ ${method} == "rsync" ]] ; then
m_root=":mirror/$MCP_VERSION/ubuntu"
elif [[ ${method} == "http" ]] ; then