Decouple installer from the base image script

This means that the base image does not have the installer anymore
and needs to be copied over.

Part of #152
This commit is contained in:
Girish Ramakrishnan
2016-12-23 16:38:46 -08:00
parent 7e592f34bd
commit fae0ba5678
6 changed files with 20 additions and 42 deletions

View File

@@ -8,9 +8,9 @@ if [[ ${EUID} -ne 0 ]]; then
fi
# change this to a hash when we make a upgrade release
readonly INSTALLER_REVISION="v0.92.1"
readonly INSTALLER_REVISION=master
readonly INIT_BASESYSTEM_SCRIPT_URL="https://git.cloudron.io/cloudron/box/raw/${INSTALLER_REVISION}/baseimage/initializeBaseUbuntuImage.sh"
readonly INSTALLER_SOURCE_DIR="/home/yellowtent/installer"
readonly INSTALLER_URL="https://git.cloudron.io/cloudron/box/raw/${INSTALLER_REVISION}/scripts/installer.sh"
readonly LOG_FILE="/var/log/cloudron-setup.log"
domain=""
@@ -101,12 +101,22 @@ if ! curl -s "${INIT_BASESYSTEM_SCRIPT_URL}" > /tmp/initializeBaseUbuntuImage.sh
fi
echo "=> Installing base dependencies ... (this takes some time)"
if ! /bin/bash /tmp/initializeBaseUbuntuImage.sh "${INSTALLER_REVISION}" "${provider}" &>> "${LOG_FILE}"; then
if ! /bin/bash /tmp/initializeBaseUbuntuImage.sh "${provider}" &>> "${LOG_FILE}"; then
echo "Init script failed. See ${LOG_FILE} for details"
exit 1
fi
rm /tmp/initializeBaseUbuntuImage.sh
echo "=> Downloading and running installer for version ${INSTALLER_REVISION}"
if ! curl -s "${INSTALLER_URL}" > /etc/installer.sh; then
echo "Could not download initialization script"
exit 1
fi
if ! /bin/bash /etc/installer.sh "${provider}" &>> "${LOG_FILE}"; then
echo "Installer failed. See ${LOG_FILE} for details"
exit 1
fi
echo "=> Checking version"
if ! npm install -g cloudron-version@0.1.1 &>> "${LOG_FILE}"; then
echo "Failed to install cloudron-version npm package"