From 555648326dd7b4f77a71d8b892008bb95747f438 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 12 May 2023 18:59:15 +0200 Subject: [PATCH 01/12] Added ddev install script --- .ddev/commands/web/install-openmage | 94 +++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 .ddev/commands/web/install-openmage diff --git a/.ddev/commands/web/install-openmage b/.ddev/commands/web/install-openmage new file mode 100755 index 00000000000..28e7156f9e3 --- /dev/null +++ b/.ddev/commands/web/install-openmage @@ -0,0 +1,94 @@ +#!/bin/bash + +## Description: Install OpenMage +## Usage: install-openmage +## Example: ddev install-openmage + +ROOT="${PWD}" + +LOCALXML="${ROOT}/app/etc/local.xml" +if [ -f "${LOCALXML}" ]; then + read -r -p "OpenMage is already installed. Delete local.xml and drop database[y/N]:" DELETE + DELETE=${DELETE,,} # to lower + if [[ "${DELETE}" =~ ^(yes|y) ]]; then + mysql -u db -h db -e "DROP SCHEMA IF EXISTS db; CREATE SCHEMA db;"; + rm "${LOCALXML}" + else + exit 1 + fi +fi + +read -r -p "Install sample data? [y/N]" INSTALL_SAMPLE_DATA +INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower +if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then + SAMPLE_DATA_URL=https://github.com/Vinai/compressed-magento-sample-data/raw/master/compressed-magento-sample-data-1.9.2.4.tgz + SAMPLE_DATA_DIRECTORY="${ROOT}/.sampleData" + SAMPLE_DATA_FILE=sample_data.tgz + + if [[ ! -d "${SAMPLE_DATA_DIRECTORY}" ]]; then + echo "Creating backup directory" + mkdir -p "${SAMPLE_DATA_DIRECTORY}" + fi + + cd "${SAMPLE_DATA_DIRECTORY}" || exit + if [[ ! -f "${SAMPLE_DATA_DIRECTORY}/${SAMPLE_DATA_FILE}" ]]; then + echo "Downloading sample data" + wget "${SAMPLE_DATA_URL}" -O "${SAMPLE_DATA_FILE}" + fi + + echo "Uncompress sample data" + tar xf "${SAMPLE_DATA_FILE}" + + echo "Copy sample data" + cp -r magento-sample-data-1.9.2.4/* "${PWD}/" + + echo "Import sample data" + mysql -u db -h db db < "${SAMPLE_DATA_DIRECTORY}/magento-sample-data-1.9.2.4/magento_sample_data_for_1.9.2.4.sql" + + # remove sample data + if [[ "${SAMPLE_DATA_KEEP_FLAG}" ]]; then + rm -rf $( + find . -maxdepth 1 -type f -name "*" ! -name "${SAMPLE_DATA_FILE}") + else + cd "${ROOT}" || exit + rm -rf "${SAMPLE_DATA_DIRECTORY}" + fi +fi + +cd "${ROOT}" || exit + +read -r -p "Admin user [admin]:" ADMIN_USER +ADMIN_USER=${ADMIN_USER:-admin} +read -r -p "Admin firstname [OpenMage]:" ADMIN_FIRSTNAME +ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-OpenMage} +read -r -p "Admin lastname [User]:" ADMIN_LASTNAME +ADMIN_LASTNAME=${ADMIN_LASTNAME:-User} +read -r -p "Admin email [admin@example.com]:" ADMIN_EMAIL +ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} +read -r -p "Admin password [veryl0ngpassw0rd]:" ADMIN_PASSWORD +ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} + +php -f install.php -- \ + --license_agreement_accepted 'yes' \ + --locale 'en_US' \ + --timezone 'America/New_York' \ + --db_host 'db' \ + --db_name 'db' \ + --db_user 'db' \ + --db_pass 'db' \ + --db_prefix '' \ + --url "${DDEV_PRIMARY_URL}" \ + --use_rewrites 'yes' \ + --use_secure 'no' \ + --secure_base_url "${DDEV_PRIMARY_URL}" \ + --use_secure_admin 'no' \ + --admin_username "${ADMIN_USER}" \ + --admin_lastname "${ADMIN_LASTNAME}" \ + --admin_firstname "${ADMIN_FIRSTNAME}" \ + --admin_email "${ADMIN_EMAIL}" \ + --admin_password "${ADMIN_PASSWORD}" \ + --session_save 'files' \ + --admin_frontname 'admin' \ + --backend_frontname 'admin' \ + --default_currency 'USD' \ + --skip_url_validation 'yes' From a5fb15280a4f5a14207aab8352a65c75513475d1 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 12 May 2023 19:12:06 +0200 Subject: [PATCH 02/12] Added db-prefix option (prefix does not work!) --- .ddev/commands/web/install-openmage | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.ddev/commands/web/install-openmage b/.ddev/commands/web/install-openmage index 28e7156f9e3..3184b52b27d 100755 --- a/.ddev/commands/web/install-openmage +++ b/.ddev/commands/web/install-openmage @@ -67,6 +67,8 @@ read -r -p "Admin email [admin@example.com]:" ADMIN_EMAIL ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} read -r -p "Admin password [veryl0ngpassw0rd]:" ADMIN_PASSWORD ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} +read -r -p "Database prefix []:" DB_PREFIX +DB_PREFIX=${DB_PREFIX:-} php -f install.php -- \ --license_agreement_accepted 'yes' \ @@ -76,7 +78,7 @@ php -f install.php -- \ --db_name 'db' \ --db_user 'db' \ --db_pass 'db' \ - --db_prefix '' \ + --db_prefix "${DB_PREFIX}" \ --url "${DDEV_PRIMARY_URL}" \ --use_rewrites 'yes' \ --use_secure 'no' \ From a343d70b95dcc88165f12ab13fc4390c02746dff Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Fri, 12 May 2023 19:42:39 +0200 Subject: [PATCH 03/12] Added flags --- .ddev/commands/web/install-openmage | 57 +++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/.ddev/commands/web/install-openmage b/.ddev/commands/web/install-openmage index 3184b52b27d..c11f731f192 100755 --- a/.ddev/commands/web/install-openmage +++ b/.ddev/commands/web/install-openmage @@ -2,10 +2,22 @@ ## Description: Install OpenMage ## Usage: install-openmage -## Example: ddev install-openmage +## Example: ddev install-openmage -d -s -k ROOT="${PWD}" +SAMPLE_DATA_FLAG='' +SAMPLE_DATA_KEEP_FLAG='' +USE_DEFAULT_FLAG='' + +while getopts 'dsk' flag; do + case "${flag}" in + d) USE_DEFAULT_FLAG='true' ;; + s) SAMPLE_DATA_FLAG='true' ;; + k) SAMPLE_DATA_KEEP_FLAG='true' ;; + esac +done + LOCALXML="${ROOT}/app/etc/local.xml" if [ -f "${LOCALXML}" ]; then read -r -p "OpenMage is already installed. Delete local.xml and drop database[y/N]:" DELETE @@ -18,8 +30,14 @@ if [ -f "${LOCALXML}" ]; then fi fi -read -r -p "Install sample data? [y/N]" INSTALL_SAMPLE_DATA -INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower +# install sample data +if [[ "${SAMPLE_DATA_KEEP_FLAG}" ]]; then + INSTALL_SAMPLE_DATA='y' +else + read -r -p "Install sample data? [y/N]" INSTALL_SAMPLE_DATA + INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower +fi + if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then SAMPLE_DATA_URL=https://github.com/Vinai/compressed-magento-sample-data/raw/master/compressed-magento-sample-data-1.9.2.4.tgz SAMPLE_DATA_DIRECTORY="${ROOT}/.sampleData" @@ -57,18 +75,27 @@ fi cd "${ROOT}" || exit -read -r -p "Admin user [admin]:" ADMIN_USER -ADMIN_USER=${ADMIN_USER:-admin} -read -r -p "Admin firstname [OpenMage]:" ADMIN_FIRSTNAME -ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-OpenMage} -read -r -p "Admin lastname [User]:" ADMIN_LASTNAME -ADMIN_LASTNAME=${ADMIN_LASTNAME:-User} -read -r -p "Admin email [admin@example.com]:" ADMIN_EMAIL -ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} -read -r -p "Admin password [veryl0ngpassw0rd]:" ADMIN_PASSWORD -ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} -read -r -p "Database prefix []:" DB_PREFIX -DB_PREFIX=${DB_PREFIX:-} +if [[ "${USE_DEFAULT_FLAG}" ]]; then + ADMIN_USER='admin' + ADMIN_FIRSTNAME='OpenMage' + ADMIN_LASTNAME='User' + ADMIN_EMAIL='admin@example.com' + ADMIN_PASSWORD='veryl0ngpassw0rd' + DB_PREFIX='' +else + read -r -p "Admin user [admin]:" ADMIN_USER + ADMIN_USER=${ADMIN_USER:-admin} + read -r -p "Admin firstname [OpenMage]:" ADMIN_FIRSTNAME + ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-OpenMage} + read -r -p "Admin lastname [User]:" ADMIN_LASTNAME + ADMIN_LASTNAME=${ADMIN_LASTNAME:-User} + read -r -p "Admin email [admin@example.com]:" ADMIN_EMAIL + ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} + read -r -p "Admin password [veryl0ngpassw0rd]:" ADMIN_PASSWORD + ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} + read -r -p "Database prefix []:" DB_PREFIX + DB_PREFIX=${DB_PREFIX:-} +fi php -f install.php -- \ --license_agreement_accepted 'yes' \ From 6bc93110cf33be07f76a85cc5dabd7d2ed06d4c8 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sat, 13 May 2023 12:19:45 +0200 Subject: [PATCH 04/12] Added quiet install flag ... drops your db w/o asking and install openmage w/ sample data --- .ddev/commands/web/install-openmage | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.ddev/commands/web/install-openmage b/.ddev/commands/web/install-openmage index c11f731f192..1c763b73643 100755 --- a/.ddev/commands/web/install-openmage +++ b/.ddev/commands/web/install-openmage @@ -2,26 +2,40 @@ ## Description: Install OpenMage ## Usage: install-openmage -## Example: ddev install-openmage -d -s -k +## Example: ddev install-openmage -d -s -k -q ROOT="${PWD}" +QUIET_INSTALL_FLAG='' SAMPLE_DATA_FLAG='' SAMPLE_DATA_KEEP_FLAG='' USE_DEFAULT_FLAG='' -while getopts 'dsk' flag; do +while getopts 'dskq' flag; do case "${flag}" in d) USE_DEFAULT_FLAG='true' ;; s) SAMPLE_DATA_FLAG='true' ;; k) SAMPLE_DATA_KEEP_FLAG='true' ;; + q) QUIET_INSTALL_FLAG='true' ;; esac done + +#quiet install +if [[ "${QUIET_INSTALL_FLAG}" ]]; then + USE_DEFAULT_FLAG='true' + SAMPLE_DATA_FLAG='true' +fi + LOCALXML="${ROOT}/app/etc/local.xml" if [ -f "${LOCALXML}" ]; then - read -r -p "OpenMage is already installed. Delete local.xml and drop database[y/N]:" DELETE - DELETE=${DELETE,,} # to lower + if [[ "${QUIET_INSTALL_FLAG}" ]]; then + DELETE='y' + else + read -r -p "OpenMage is already installed. Delete local.xml and drop database[y/N]:" DELETE + DELETE=${DELETE,,} # to lower + fi + if [[ "${DELETE}" =~ ^(yes|y) ]]; then mysql -u db -h db -e "DROP SCHEMA IF EXISTS db; CREATE SCHEMA db;"; rm "${LOCALXML}" @@ -31,7 +45,7 @@ if [ -f "${LOCALXML}" ]; then fi # install sample data -if [[ "${SAMPLE_DATA_KEEP_FLAG}" ]]; then +if [[ "${SAMPLE_DATA_FLAG}" ]]; then INSTALL_SAMPLE_DATA='y' else read -r -p "Install sample data? [y/N]" INSTALL_SAMPLE_DATA From 4f8be64d3d34317d37ed1181e4b7fbd596741091 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 16:48:07 +0200 Subject: [PATCH 05/12] @ADDISON74 suggestions --- .../{install-openmage => openmage-install} | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) rename .ddev/commands/web/{install-openmage => openmage-install} (80%) diff --git a/.ddev/commands/web/install-openmage b/.ddev/commands/web/openmage-install similarity index 80% rename from .ddev/commands/web/install-openmage rename to .ddev/commands/web/openmage-install index 1c763b73643..c8ed6bd01fd 100755 --- a/.ddev/commands/web/install-openmage +++ b/.ddev/commands/web/openmage-install @@ -1,8 +1,8 @@ #!/bin/bash ## Description: Install OpenMage -## Usage: install-openmage -## Example: ddev install-openmage -d -s -k -q +## Usage: openmage-install +## Example: ddev openmage-install -d -s -k -q ROOT="${PWD}" @@ -32,7 +32,7 @@ if [ -f "${LOCALXML}" ]; then if [[ "${QUIET_INSTALL_FLAG}" ]]; then DELETE='y' else - read -r -p "OpenMage is already installed. Delete local.xml and drop database[y/N]:" DELETE + read -r -p "OpenMage is already installed. Delete local.xml and drop database [y/N]: " DELETE DELETE=${DELETE,,} # to lower fi @@ -48,7 +48,7 @@ fi if [[ "${SAMPLE_DATA_FLAG}" ]]; then INSTALL_SAMPLE_DATA='y' else - read -r -p "Install sample data? [y/N]" INSTALL_SAMPLE_DATA + read -r -p "Install sample data? [y/N]: " INSTALL_SAMPLE_DATA INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower fi @@ -92,23 +92,23 @@ cd "${ROOT}" || exit if [[ "${USE_DEFAULT_FLAG}" ]]; then ADMIN_USER='admin' ADMIN_FIRSTNAME='OpenMage' - ADMIN_LASTNAME='User' + ADMIN_LASTNAME='Administrator' ADMIN_EMAIL='admin@example.com' ADMIN_PASSWORD='veryl0ngpassw0rd' - DB_PREFIX='' + TABLE_PREFIX='' else - read -r -p "Admin user [admin]:" ADMIN_USER + read -r -p "Admin user [admin]: " ADMIN_USER ADMIN_USER=${ADMIN_USER:-admin} - read -r -p "Admin firstname [OpenMage]:" ADMIN_FIRSTNAME + read -r -p "Admin firstname [OpenMage]: " ADMIN_FIRSTNAME ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-OpenMage} - read -r -p "Admin lastname [User]:" ADMIN_LASTNAME - ADMIN_LASTNAME=${ADMIN_LASTNAME:-User} - read -r -p "Admin email [admin@example.com]:" ADMIN_EMAIL + read -r -p "Admin lastname [Administrator]: " ADMIN_LASTNAME + ADMIN_LASTNAME=${ADMIN_LASTNAME:-Administrator} + read -r -p "Admin email [admin@example.com]: " ADMIN_EMAIL ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} - read -r -p "Admin password [veryl0ngpassw0rd]:" ADMIN_PASSWORD + read -r -p "Admin password [veryl0ngpassw0rd]: " ADMIN_PASSWORD ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} - read -r -p "Database prefix []:" DB_PREFIX - DB_PREFIX=${DB_PREFIX:-} + read -r -p "Table prefix []: " TABLE_PREFIX + TABLE_PREFIX=${TABLE_PREFIX:-} fi php -f install.php -- \ @@ -119,12 +119,12 @@ php -f install.php -- \ --db_name 'db' \ --db_user 'db' \ --db_pass 'db' \ - --db_prefix "${DB_PREFIX}" \ + --db_prefix "${TABLE_PREFIX}" \ --url "${DDEV_PRIMARY_URL}" \ --use_rewrites 'yes' \ - --use_secure 'no' \ + --use_secure 'yes' \ --secure_base_url "${DDEV_PRIMARY_URL}" \ - --use_secure_admin 'no' \ + --use_secure_admin 'yes' \ --admin_username "${ADMIN_USER}" \ --admin_lastname "${ADMIN_LASTNAME}" \ --admin_firstname "${ADMIN_FIRSTNAME}" \ @@ -134,4 +134,5 @@ php -f install.php -- \ --admin_frontname 'admin' \ --backend_frontname 'admin' \ --default_currency 'USD' \ + --enable_charts 'yes' \ --skip_url_validation 'yes' From 68c2f3fc19961f7347f453e91c4326a629e883c0 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 17:36:32 +0200 Subject: [PATCH 06/12] Updated flags, fix --help --- .ddev/commands/web/openmage-install | 52 +++++++++++++++++++---------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index c8ed6bd01fd..6f9e6d72693 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -1,8 +1,10 @@ #!/bin/bash +## ProjectTypes: magento ## Description: Install OpenMage -## Usage: openmage-install -## Example: ddev openmage-install -d -s -k -q +## Usage: openmage-install [-d|--default] [-s|--sampledata] [-k|--keep] [-q|--quiet] +## Example: ddev openmage-install -d -s -k +## Flags: [{"Name":"default","Shorthand":"d","Usage":"use default values"},{"Name":"sampledata","Shorthand":"s","Usage":"install sample data"},{"Name":"keep","Shorthand":"k","Usage":"keep sample data package"},{"Name":"quiet","Shorthand":"q","Usage":"silent install with sample data"}] ROOT="${PWD}" @@ -11,15 +13,29 @@ SAMPLE_DATA_FLAG='' SAMPLE_DATA_KEEP_FLAG='' USE_DEFAULT_FLAG='' -while getopts 'dskq' flag; do - case "${flag}" in - d) USE_DEFAULT_FLAG='true' ;; - s) SAMPLE_DATA_FLAG='true' ;; - k) SAMPLE_DATA_KEEP_FLAG='true' ;; - q) QUIET_INSTALL_FLAG='true' ;; - esac -done - +while :; do + case ${1:-} in + -d|--default) + USE_DEFAULT_FLAG='true' ;; + -s|--sampledata) + SAMPLE_DATA_FLAG='true' ;; + -k|--keep) + SAMPLE_DATA_KEEP_FLAG='true' ;; + -q|--quiet) + QUIET_INSTALL_FLAG='true' ;; + --) # End of all options. + shift + break + ;; + -?*) + printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 + ;; + *) # Default case: No more options, so break out of the loop. + break + esac + + shift + done #quiet install if [[ "${QUIET_INSTALL_FLAG}" ]]; then @@ -32,7 +48,7 @@ if [ -f "${LOCALXML}" ]; then if [[ "${QUIET_INSTALL_FLAG}" ]]; then DELETE='y' else - read -r -p "OpenMage is already installed. Delete local.xml and drop database [y/N]: " DELETE + read -r -p "OpenMage is already installed. Delete local.xml and drop database [y/N] " DELETE DELETE=${DELETE,,} # to lower fi @@ -48,7 +64,7 @@ fi if [[ "${SAMPLE_DATA_FLAG}" ]]; then INSTALL_SAMPLE_DATA='y' else - read -r -p "Install sample data? [y/N]: " INSTALL_SAMPLE_DATA + read -r -p "Install sample data? [y/N] " INSTALL_SAMPLE_DATA INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower fi @@ -58,23 +74,23 @@ if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then SAMPLE_DATA_FILE=sample_data.tgz if [[ ! -d "${SAMPLE_DATA_DIRECTORY}" ]]; then - echo "Creating backup directory" + echo "Creating backup directory ..." mkdir -p "${SAMPLE_DATA_DIRECTORY}" fi cd "${SAMPLE_DATA_DIRECTORY}" || exit if [[ ! -f "${SAMPLE_DATA_DIRECTORY}/${SAMPLE_DATA_FILE}" ]]; then - echo "Downloading sample data" + echo "Downloading sample data ..." wget "${SAMPLE_DATA_URL}" -O "${SAMPLE_DATA_FILE}" fi - echo "Uncompress sample data" + echo "Uncompress sample data ..." tar xf "${SAMPLE_DATA_FILE}" - echo "Copy sample data" + echo "Copy sample data ..." cp -r magento-sample-data-1.9.2.4/* "${PWD}/" - echo "Import sample data" + echo "Import sample data ..." mysql -u db -h db db < "${SAMPLE_DATA_DIRECTORY}/magento-sample-data-1.9.2.4/magento_sample_data_for_1.9.2.4.sql" # remove sample data From 8d38d9d76a82d198ba848dadf51cdf7b5450c517 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 18:03:24 +0200 Subject: [PATCH 07/12] Minor change --- .ddev/commands/web/openmage-install | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index 6f9e6d72693..0f4c417e57b 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -22,7 +22,10 @@ while :; do -k|--keep) SAMPLE_DATA_KEEP_FLAG='true' ;; -q|--quiet) - QUIET_INSTALL_FLAG='true' ;; + QUIET_INSTALL_FLAG='true' + USE_DEFAULT_FLAG='true' + SAMPLE_DATA_FLAG='true' + ;; --) # End of all options. shift break @@ -37,12 +40,6 @@ while :; do shift done -#quiet install -if [[ "${QUIET_INSTALL_FLAG}" ]]; then - USE_DEFAULT_FLAG='true' - SAMPLE_DATA_FLAG='true' -fi - LOCALXML="${ROOT}/app/etc/local.xml" if [ -f "${LOCALXML}" ]; then if [[ "${QUIET_INSTALL_FLAG}" ]]; then From bbe56c523ad61cab00dfd5043472ea938d6473ae Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 18:07:18 +0200 Subject: [PATCH 08/12] Wording --- .ddev/commands/web/openmage-install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index 0f4c417e57b..91e7abc4a80 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -81,13 +81,13 @@ if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then wget "${SAMPLE_DATA_URL}" -O "${SAMPLE_DATA_FILE}" fi - echo "Uncompress sample data ..." + echo "Uncompressing sample data ..." tar xf "${SAMPLE_DATA_FILE}" - echo "Copy sample data ..." + echo "Copying sample data ..." cp -r magento-sample-data-1.9.2.4/* "${PWD}/" - echo "Import sample data ..." + echo "Importing sample data ..." mysql -u db -h db db < "${SAMPLE_DATA_DIRECTORY}/magento-sample-data-1.9.2.4/magento_sample_data_for_1.9.2.4.sql" # remove sample data From decfcb6c11d3dfaf464e8d7c308470b2d1bf8c16 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 18:16:51 +0200 Subject: [PATCH 09/12] Disallow table-prefix when sample data is used --- .ddev/commands/web/openmage-install | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index 91e7abc4a80..d2dde981e0a 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -120,8 +120,12 @@ else ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} read -r -p "Admin password [veryl0ngpassw0rd]: " ADMIN_PASSWORD ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} - read -r -p "Table prefix []: " TABLE_PREFIX - TABLE_PREFIX=${TABLE_PREFIX:-} + if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then + TABLE_PREFIX='' + else + read -r -p "Table prefix []: " TABLE_PREFIX + TABLE_PREFIX=${TABLE_PREFIX:-} + fi fi php -f install.php -- \ From 8275b2bd1292d67166d557b11ef0cfc72fd8f78c Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 May 2023 23:15:05 +0200 Subject: [PATCH 10/12] Added default table prefix --- .ddev/commands/web/openmage-install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index d2dde981e0a..395aa8be097 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -108,7 +108,7 @@ if [[ "${USE_DEFAULT_FLAG}" ]]; then ADMIN_LASTNAME='Administrator' ADMIN_EMAIL='admin@example.com' ADMIN_PASSWORD='veryl0ngpassw0rd' - TABLE_PREFIX='' + TABLE_PREFIX='om_' else read -r -p "Admin user [admin]: " ADMIN_USER ADMIN_USER=${ADMIN_USER:-admin} @@ -123,8 +123,8 @@ else if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then TABLE_PREFIX='' else - read -r -p "Table prefix []: " TABLE_PREFIX - TABLE_PREFIX=${TABLE_PREFIX:-} + read -r -p "Table prefix [om_]: " TABLE_PREFIX + TABLE_PREFIX=${TABLE_PREFIX:-om_} fi fi From 196b70913294695b6bf048514debe7048e906e8c Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 15 May 2023 15:40:17 +0200 Subject: [PATCH 11/12] Fixed table prefix --- .ddev/commands/web/openmage-install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index 395aa8be097..feb955b3bac 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -123,8 +123,7 @@ else if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then TABLE_PREFIX='' else - read -r -p "Table prefix [om_]: " TABLE_PREFIX - TABLE_PREFIX=${TABLE_PREFIX:-om_} + read -r -e -i 'om_' -p "Table prefix [om_]: " TABLE_PREFIX fi fi From 7680f73323604e93fafa7bd0a31521f54d468524 Mon Sep 17 00:00:00 2001 From: ADDISON <8360474+ADDISON74@users.noreply.github.com> Date: Tue, 4 Jul 2023 00:01:01 +0300 Subject: [PATCH 12/12] phrase-changes Changes in phrases and where the /media and /skin directories are copied --- .ddev/commands/web/openmage-install | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.ddev/commands/web/openmage-install b/.ddev/commands/web/openmage-install index feb955b3bac..d4b86fb0e92 100755 --- a/.ddev/commands/web/openmage-install +++ b/.ddev/commands/web/openmage-install @@ -45,7 +45,7 @@ if [ -f "${LOCALXML}" ]; then if [[ "${QUIET_INSTALL_FLAG}" ]]; then DELETE='y' else - read -r -p "OpenMage is already installed. Delete local.xml and drop database [y/N] " DELETE + read -r -p "OpenMage is already installed. Delete local.xml and drop the database? [y/N] " DELETE DELETE=${DELETE,,} # to lower fi @@ -61,7 +61,7 @@ fi if [[ "${SAMPLE_DATA_FLAG}" ]]; then INSTALL_SAMPLE_DATA='y' else - read -r -p "Install sample data? [y/N] " INSTALL_SAMPLE_DATA + read -r -p "Install Sample Data? [y/N] " INSTALL_SAMPLE_DATA INSTALL_SAMPLE_DATA=${INSTALL_SAMPLE_DATA,,} # to lower fi @@ -71,23 +71,23 @@ if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then SAMPLE_DATA_FILE=sample_data.tgz if [[ ! -d "${SAMPLE_DATA_DIRECTORY}" ]]; then - echo "Creating backup directory ..." + echo "Creating Sample Data directory..." mkdir -p "${SAMPLE_DATA_DIRECTORY}" fi cd "${SAMPLE_DATA_DIRECTORY}" || exit if [[ ! -f "${SAMPLE_DATA_DIRECTORY}/${SAMPLE_DATA_FILE}" ]]; then - echo "Downloading sample data ..." + echo "Downloading Sample Data..." wget "${SAMPLE_DATA_URL}" -O "${SAMPLE_DATA_FILE}" fi - echo "Uncompressing sample data ..." + echo "Uncompressing Sample Data..." tar xf "${SAMPLE_DATA_FILE}" - echo "Copying sample data ..." - cp -r magento-sample-data-1.9.2.4/* "${PWD}/" + echo "Copying Sample Data into the OpenMage directory..." + cp -r magento-sample-data-1.9.2.4/* "${ROOT}/" - echo "Importing sample data ..." + echo "Importing Sample Data into the database..." mysql -u db -h db db < "${SAMPLE_DATA_DIRECTORY}/magento-sample-data-1.9.2.4/magento_sample_data_for_1.9.2.4.sql" # remove sample data @@ -110,20 +110,20 @@ if [[ "${USE_DEFAULT_FLAG}" ]]; then ADMIN_PASSWORD='veryl0ngpassw0rd' TABLE_PREFIX='om_' else - read -r -p "Admin user [admin]: " ADMIN_USER + read -r -p "Admin User [admin]: " ADMIN_USER ADMIN_USER=${ADMIN_USER:-admin} - read -r -p "Admin firstname [OpenMage]: " ADMIN_FIRSTNAME + read -r -p "Admin Firstname [OpenMage]: " ADMIN_FIRSTNAME ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-OpenMage} - read -r -p "Admin lastname [Administrator]: " ADMIN_LASTNAME + read -r -p "Admin Lastname [Administrator]: " ADMIN_LASTNAME ADMIN_LASTNAME=${ADMIN_LASTNAME:-Administrator} - read -r -p "Admin email [admin@example.com]: " ADMIN_EMAIL + read -r -p "Admin Email [admin@example.com]: " ADMIN_EMAIL ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com} - read -r -p "Admin password [veryl0ngpassw0rd]: " ADMIN_PASSWORD + read -r -p "Admin Password [veryl0ngpassw0rd]: " ADMIN_PASSWORD ADMIN_PASSWORD=${ADMIN_PASSWORD:-veryl0ngpassw0rd} if [[ $INSTALL_SAMPLE_DATA =~ ^(yes|y) ]]; then TABLE_PREFIX='' else - read -r -e -i 'om_' -p "Table prefix [om_]: " TABLE_PREFIX + read -r -e -i 'om_' -p "Table Prefix [om_]: " TABLE_PREFIX fi fi