Skip to content

Commit

Permalink
Version v0.3.1
Browse files Browse the repository at this point in the history
Changelog
* Cache downloaded archive files for faster creation of a new shop (directory configurable via MAGE_DOWNLOAD_DIR)
  • Loading branch information
mzeis committed Mar 24, 2013
1 parent dd270f3 commit c948173
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 12 deletions.
3 changes: 3 additions & 0 deletions README.markdown
Expand Up @@ -190,6 +190,9 @@ This is how it looks on my VM:

## Changelog

### v0.3.1
* Cache downloaded archive files for faster creation of a new shop (directory configurable via MAGE_DOWNLOAD_DIR)

### v0.3
* Added command line parameters for automatic installation

Expand Down
1 change: 1 addition & 0 deletions config.conf.sample
@@ -1,3 +1,4 @@
MAGE_DOWNLOAD_DIR="/tmp/MageSpawner/" # Directory in which downloaded Magento files can be stored
MAGE_DOMAIN="magentoshops.vm" # The shops will be created under this subdomain
MAGE_DEFAULT_NAME="shop" # Preset for the shop name. The shop name is used
# as part of the domain, directory and database name.
Expand Down
34 changes: 22 additions & 12 deletions install
Expand Up @@ -20,7 +20,7 @@
# - The following commands must be locatable in your $PATH
# basename command mysql php sed tar wget (or curl)

version="0.3"
version="0.3.1"
usage="\
MageSpawner (v$version)
Expand Down Expand Up @@ -136,6 +136,24 @@ init_spawner ()
return 0
}

###########################
## Get Magento archive file

get_magento_archive_file ()
{
if [[ ! -f $MAGE_DOWNLOAD_PATH ]]; then
mkdir -p ${MAGE_DOWNLOAD_DIR}
echo -e "Downloading Magento package..."
if [[ $WGET != "" ]]; then
wget -O $MAGE_DOWNLOAD_PATH $MAGE_DOWNLOAD_URL
elif [[ $CURL != "" ]]; then
curl $MAGE_DOWNLOAD_URL -o $MAGE_DOWNLOAD_PATH
fi
echo -e "Package downloaded.\n"
fi
return 0;
}

###########################
## Get Magento download URL

Expand Down Expand Up @@ -332,25 +350,17 @@ MAGE_SECURE_URL="http://${MAGE_SHOPDOMAIN}"
MAGE_DOWNLOAD_FILENAME=$(basename $MAGE_DOWNLOAD_URL)
DB_NAME="${DB_NAMEPREFIX}${MAGE_NAME}"
DB_SQL="CREATE DATABASE IF NOT EXISTS ${DB_NAME} CHARACTER SET utf8 COLLATE utf8_general_ci;"
MAGE_DOWNLOAD_PATH="${MAGE_DOWNLOAD_DIR}${MAGE_DOWNLOAD_FILENAME}"

echo -e "Thanks, the required information was provided. The installation will now begin.\n"

cd $MAGE_BASE_DIR

echo -e "Downloading Magento package..."

if [[ $WGET != "" ]]; then
wget $MAGE_DOWNLOAD_URL
elif [[ $CURL != "" ]]; then
curl -O $MAGE_DOWNLOAD_URL
fi

echo -e "Package downloaded.\n"
get_magento_archive_file

echo "Unpacking package and setting permissions."
tar -zxf $MAGE_DOWNLOAD_FILENAME
tar -zxf $MAGE_DOWNLOAD_PATH
mv magento/ "$MAGE_SHOPDOMAIN"/
rm -f $MAGE_DOWNLOAD_FILENAME
cd "$MAGE_SHOPDOMAIN"/
$CMDCHMOD $LINUX_PERM_WRITABLE_FOLDERS . app/etc var/ media/
echo -e "Package unpacked and permssions set.\n"
Expand Down

0 comments on commit c948173

Please sign in to comment.