diff --git a/recipes/alpine/provisionning/matchbox.sh b/recipes/alpine/provisionning/matchbox.sh index f7182e7..8db2bb3 100644 --- a/recipes/alpine/provisionning/matchbox.sh +++ b/recipes/alpine/provisionning/matchbox.sh @@ -30,6 +30,33 @@ mkdir -p "${ASSETS_DIR}" chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${MATCHBOX_DIR}" chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}" -cp -rp ./scripts/tls /root/.secrets +tout=30 +item=1 +echo "Provisionning matchbox with flatcar images" +echo " * Current stable image (try 1)" +for version in ${FL_VERSIONS}; do + while ! bash -x /usr/local/bin/get-flatcar stable ${version} ${ASSETS_DIR}; do + sleep 1 + echo " * ${version} stable image (try ${item})" + if [ "${tout}" -eq "${item}" ]; then + break + exit 1 + fi + item=$((item+1)) + done +done + +echo " * 3374.2.0 stable image (try 1)" +get-flatcar stable 3374.2.0 "${ASSETS_DIR}" +if [ "${?}" -ne 0 ]; then + sleep 3 + echo " * 3374.2.0 stable image (try 2)" + get-flatcar stable 3374.2.0 "${ASSETS_DIR}" +fi + +chown -R "${MATCHBOX_USER}:${MATCHBOX_USER}" "${ASSETS_DIR}" +ls -lhaR ${ASSETS_DIR} + +cp -rp ./scripts/tls /root exit "${?}" \ No newline at end of file