Skip to content

Instantly share code, notes, and snippets.

@matthewhaworth
Last active January 1, 2016 06:09
Show Gist options
  • Select an option

  • Save matthewhaworth/bfc300ecb5a75618d0d5 to your computer and use it in GitHub Desktop.

Select an option

Save matthewhaworth/bfc300ecb5a75618d0d5 to your computer and use it in GitHub Desktop.

Revisions

  1. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -44,18 +44,18 @@ fi

    cd $INSTALL_PATH

    wget -quiet http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz
    wget --quiet http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-$MAGENTO_VERSION.tar.gz

    if [ "$MAGENTO_VERSION_RAW" -lt 1610 ]
    then
    wget -quiet http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    wget --quiet http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    tar -zxvf magento-sample-data-1.2.0.tar.gz
    mv magento-sample-data-1.2.0/media/* magento/media/
    mv magento-sample-data-1.2.0/magento-sample-data-1.2.0.sql magento/data.sql
    else
    wget -quiet http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    wget --quiet http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    tar -zxvf magento-sample-data-1.6.1.0.tar.gz
    mv magento-sample-data-1.6.1.0/media/* magento/media/
    mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
  2. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -76,7 +76,7 @@ php -f install.php -- \
    --timezone "Europe/London" \
    --default_currency "GBP" \
    --db_host "localhost" \
    --db_name $DB_NAME \
    --db_name "$DB_NAME" \
    --db_user "root" \
    --db_pass "" \
    --use_rewrites "yes" \
    @@ -88,7 +88,7 @@ php -f install.php -- \
    --admin_email "jenkins@codepool.co.uk" \
    --admin_username "codepool" \
    --admin_password "codepool123" \
    --url $MAGE_URL
    --url "$MAGE_URL"

    touch var/.htaccess | mkdir app/etc
    chmod o+w var var/.htaccess app/etc
  3. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -44,18 +44,18 @@ fi

    cd $INSTALL_PATH

    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz
    wget -quiet http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-$MAGENTO_VERSION.tar.gz

    if [ "$MAGENTO_VERSION_RAW" -lt 1610 ]
    then
    wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    wget -quiet http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    tar -zxvf magento-sample-data-1.2.0.tar.gz
    mv magento-sample-data-1.2.0/media/* magento/media/
    mv magento-sample-data-1.2.0/magento-sample-data-1.2.0.sql magento/data.sql
    else
    wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    wget -quiet http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    tar -zxvf magento-sample-data-1.6.1.0.tar.gz
    mv magento-sample-data-1.6.1.0/media/* magento/media/
    mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
  4. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -66,9 +66,9 @@ chmod -R o+w media

    DB_NAME=$(pwd | tr -d '/')

    mysql -h localhost -u root -e "DROP DATABASE $DB_NAME"
    mysql -h localhost -u root -e "CREATE DATABASE $DB_NAME"
    mysql -h localhost -u root $DB_NAME < data.sql
    mysql -h localhost -uroot -e "DROP DATABASE $DB_NAME"
    mysql -h localhost -uroot -e "CREATE DATABASE $DB_NAME"
    mysql -h localhost -uroot $DB_NAME < data.sql

    php -f install.php -- \
    --license_agreement_accepted "yes" \
  5. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -88,7 +88,7 @@ php -f install.php -- \
    --admin_email "jenkins@codepool.co.uk" \
    --admin_username "codepool" \
    --admin_password "codepool123" \
    --url $INSTALL_PATH
    --url $MAGE_URL

    touch var/.htaccess | mkdir app/etc
    chmod o+w var var/.htaccess app/etc
  6. matthewhaworth revised this gist Jan 4, 2014. 1 changed file with 46 additions and 6 deletions.
    52 changes: 46 additions & 6 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,49 @@
    #!/bin/sh

    MAGENTO_VERSION=1.7.0.2
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')
    DEFAULT_MAGENTO_VERSION=1.7.0.2
    DEFAULT_MAGE_URL="http://127.0.0.1/"

    if [ -z $1 ] # Magento version
    then
    read -p "Choose Magento version ($DEFAULT_MAGENTO_VERSION): " MAGENTO_VERSION
    if [ -z "$MAGENTO_VERSION" ]
    then
    MAGENTO_VERSION=$DEFAULT_MAGENTO_VERSION
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')
    fi
    else
    MAGENTO_VERSION=$1
    fi

    if [ -z $2 ] # Installation path
    then
    read -p "Choose installation path ($(pwd)): " INSTALL_PATH
    if [ -z "$INSTALL_PATH" ]
    then
    INSTALL_PATH=$(pwd)
    fi
    else
    INSTALL_PATH=$2
    fi

    if [ -z $3 ] # Magento URL
    then
    read -p "Choose Magento url ($DEFAULT_MAGE_URL): " MAGE_URL
    if [ -z "$MAGE_URL" ]
    then
    MAGE_URL=$DEFAULT_MAGE_URL
    fi
    else
    MAGE_URL=$3
    fi

    if [ ! -d $INSTALL_PATH ]
    then
    mkdir -p $INSTALL_PATH
    fi

    cd $INSTALL_PATH

    #mkdir SUBDIRECTORY
    #cd SUBDIRECTORY
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-$MAGENTO_VERSION.tar.gz
    @@ -34,7 +73,7 @@ mysql -h localhost -u root $DB_NAME < data.sql
    php -f install.php -- \
    --license_agreement_accepted "yes" \
    --locale "en_GB" \
    --timezone "America/Los_Angeles" \
    --timezone "Europe/London" \
    --default_currency "GBP" \
    --db_host "localhost" \
    --db_name $DB_NAME \
    @@ -48,7 +87,8 @@ php -f install.php -- \
    --admin_lastname "codepool" \
    --admin_email "jenkins@codepool.co.uk" \
    --admin_username "codepool" \
    --admin_password "codepool123"
    --admin_password "codepool123" \
    --url $INSTALL_PATH

    touch var/.htaccess | mkdir app/etc
    chmod o+w var var/.htaccess app/etc
  7. matthewhaworth revised this gist Dec 26, 2013. 1 changed file with 26 additions and 4 deletions.
    30 changes: 26 additions & 4 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,8 @@
    MAGENTO_VERSION=1.7.0.2
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    mkdir SUBDIRECTORY
    cd SUBDIRECTORY
    #mkdir SUBDIRECTORY
    #cd SUBDIRECTORY
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-$MAGENTO_VERSION.tar.gz
    @@ -24,9 +24,31 @@ fi

    mv magento/* magento/.htaccess .
    chmod -R o+w media
    mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql

    # .. download and install
    DB_NAME=$(pwd | tr -d '/')

    mysql -h localhost -u root -e "DROP DATABASE $DB_NAME"
    mysql -h localhost -u root -e "CREATE DATABASE $DB_NAME"
    mysql -h localhost -u root $DB_NAME < data.sql

    php -f install.php -- \
    --license_agreement_accepted "yes" \
    --locale "en_GB" \
    --timezone "America/Los_Angeles" \
    --default_currency "GBP" \
    --db_host "localhost" \
    --db_name $DB_NAME \
    --db_user "root" \
    --db_pass "" \
    --use_rewrites "yes" \
    --use_secure "no" \
    --secure_base_url "" \
    --use_secure_admin "no" \
    --admin_firstname "codepool" \
    --admin_lastname "codepool" \
    --admin_email "jenkins@codepool.co.uk" \
    --admin_username "codepool" \
    --admin_password "codepool123"

    touch var/.htaccess | mkdir app/etc
    chmod o+w var var/.htaccess app/etc
  8. matthewhaworth revised this gist Dec 24, 2013. 1 changed file with 3 additions and 18 deletions.
    21 changes: 3 additions & 18 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -3,28 +3,13 @@
    MAGENTO_VERSION=1.7.0.2
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    TARGET_PATH=/var/www/projects/app55/magento$MAGENTO_VERSION

    TEMP_MAGE_PATH=/tmp/mage$(date +"%s").tar.gz

    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz -O $TEMP_MAGE_PATH

    tar -C $TARGET_PATH -xvf $TEMP_MAGE_PATH

    rm -rf $TEMP_MAGE_PATH

    # Actual script

    MAGENTO_VERSION=1.7.0.2
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    mkdir SUBDIRECTORY
    cd SUBDIRECTORY
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-downloader-$MAGENTO_VERSION.tar.gz
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-downloader-$MAGENTO_VERSION.tar.gz
    tar -zxvf magento-$MAGENTO_VERSION.tar.gz

    if [$MAGENTO_VERSION_RAW -lt 1610]
    if [ "$MAGENTO_VERSION_RAW" -lt 1610 ]
    then
    wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    tar -zxvf magento-sample-data-1.2.0.tar.gz
  9. matthewhaworth revised this gist Dec 24, 2013. 1 changed file with 37 additions and 2 deletions.
    39 changes: 37 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    #!/bin/sh

    MAGENTO_VERSION=1.7.0.2

    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    TARGET_PATH=/var/www/projects/app55/magento$MAGENTO_VERSION
    @@ -12,4 +11,40 @@ wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$M

    tar -C $TARGET_PATH -xvf $TEMP_MAGE_PATH

    rm -rf $TEMP_MAGE_PATH
    rm -rf $TEMP_MAGE_PATH

    # Actual script

    MAGENTO_VERSION=1.7.0.2
    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    mkdir SUBDIRECTORY
    cd SUBDIRECTORY
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-downloader-$MAGENTO_VERSION.tar.gz

    tar -zxvf magento-downloader-$MAGENTO_VERSION.tar.gz

    if [$MAGENTO_VERSION_RAW -lt 1610]
    then
    wget http://www.magentocommerce.com/downloads/assets/1.2.0/magento-sample-data-1.2.0.tar.gz
    tar -zxvf magento-sample-data-1.2.0.tar.gz
    mv magento-sample-data-1.2.0/media/* magento/media/
    mv magento-sample-data-1.2.0/magento-sample-data-1.2.0.sql magento/data.sql
    else
    wget http://www.magentocommerce.com/downloads/assets/1.6.1.0/magento-sample-data-1.6.1.0.tar.gz
    tar -zxvf magento-sample-data-1.6.1.0.tar.gz
    mv magento-sample-data-1.6.1.0/media/* magento/media/
    mv magento-sample-data-1.6.1.0/magento_sample_data_for_1.6.1.0.sql magento/data.sql
    fi

    mv magento/* magento/.htaccess .
    chmod -R o+w media
    mysql -h DBHOST -u DBUSER -pDBPASS DBNAME < data.sql

    # .. download and install

    touch var/.htaccess | mkdir app/etc
    chmod o+w var var/.htaccess app/etc
    rm -rf downloader/pearlib/cache/* downloader/pearlib/download/*
    rm -rf magento/ magento-sample-data-1.6.1.0/
    rm -rf magento-downloader-1.7.0.0.tar.gz magento-sample-data-1.6.1.0.tar.gz data.sql
  10. matthewhaworth revised this gist Dec 23, 2013. 1 changed file with 10 additions and 1 deletion.
    11 changes: 10 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,15 @@
    #!/bin/sh

    MAGENTO_VERSION=1.7.0.2
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz -O /tmp/mage$MAGENTO_VERSION.tar.gz

    MAGENTO_VERSION_RAW=$(echo $MAGENTO_VERSION | tr -d '.')

    TARGET_PATH=/var/www/projects/app55/magento$MAGENTO_VERSION

    TEMP_MAGE_PATH=/tmp/mage$(date +"%s").tar.gz

    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz -O $TEMP_MAGE_PATH

    tar -C $TARGET_PATH -xvf $TEMP_MAGE_PATH

    rm -rf $TEMP_MAGE_PATH
  11. matthewhaworth created this gist Dec 23, 2013.
    6 changes: 6 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    #!/bin/sh

    MAGENTO_VERSION=1.7.0.2
    wget http://www.magentocommerce.com/downloads/assets/$MAGENTO_VERSION/magento-$MAGENTO_VERSION.tar.gz -O /tmp/mage$MAGENTO_VERSION.tar.gz