diff --git a/README.md b/README.md index 64c0454..2dc0c24 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,30 @@ Stores → Configuration → Dropday → Order Automation - Test Mode - Enable Test mode - Account ID - Account ID from Dropday Dashboard - API Key - Secret Key be provided by Dropday Dashboard + + + + +Setup by Docker +=============== + + +``` +docker-compose up -d +``` + +It will take some time to deploy the setup in contaier + +### Setup magento password + +``` +sh password.sh +``` + +### To install extension + +``` +sh install-dropday.sh +``` + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..94ea687 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,46 @@ + +version: '2' +services: + mariadb: + image: docker.io/bitnami/mariadb:10.6 + platform: linux/arm64/v8 + environment: + # ALLOW_EMPTY_PASSWORD is recommended only for development. + - ALLOW_EMPTY_PASSWORD=yes + - MARIADB_USER=bn_magento + - MARIADB_DATABASE=bitnami_magento + volumes: + - 'mariadb_data:/bitnami/mariadb' + magento: + image: bitnami/magento:latest + platform: linux/arm64/v8 + ports: + - '80:8080' + - '443:8443' + environment: + - MAGENTO_HOST=localhost + - MAGENTO_DATABASE_HOST=mariadb + - MAGENTO_DATABASE_PORT_NUMBER=3306 + - MAGENTO_DATABASE_USER=bn_magento + - MAGENTO_DATABASE_NAME=bitnami_magento + - ELASTICSEARCH_HOST=elasticsearch + - ELASTICSEARCH_PORT_NUMBER=9200 + # ALLOW_EMPTY_PASSWORD is recommended only for development. + - ALLOW_EMPTY_PASSWORD=yes + volumes: + - 'magento_data:/bitnami/magento' + depends_on: + - mariadb + - elasticsearch + elasticsearch: + image: docker.io/bitnami/elasticsearch:7 + platform: linux/arm64/v8 + volumes: + - 'elasticsearch_data:/bitnami/elasticsearch/data' +volumes: + mariadb_data: + driver: local + magento_data: + driver: local + elasticsearch_data: + driver: local diff --git a/install-dropday.sh b/install-dropday.sh new file mode 100644 index 0000000..15fc405 --- /dev/null +++ b/install-dropday.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +# Name of the Magento container +CONTAINER_NAME="magento-magento-1" + +# Ask for the username and password +read -p "Enter Dropday Username: " USERNAME +read -s -p "Enter Dropday Password: " PASSWORD +echo + +# Enter the Magento Docker container +docker exec -it $CONTAINER_NAME bash -c " +# Set up authentication for Composer +composer global config http-basic.repo.magento.com \"$USERNAME\" \"$PASSWORD\" + +# Navigate to the Magento directory +cd /bitnami/magento/ + +# Use composer to install the Dropday extension +composer require dropday-io/module-orderautomation + +# Run Magento commands to setup and compile the extension +bin/magento setup:upgrade +bin/magento setup:di:compile +bin/magento cache:clean +" + +echo "Dropday extension installation completed." + diff --git a/password.sh b/password.sh new file mode 100644 index 0000000..ee7b637 --- /dev/null +++ b/password.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Name of the Magento container +CONTAINER_NAME="magento-magento-1" + +# Admin user details +ADMIN_USER="admin-testing" +ADMIN_PASSWORD="NewPass123" +ADMIN_EMAIL="admin-testing@example.com" + +# Enter the Magento Docker container, create the admin user, and then display the result. +docker exec -it $CONTAINER_NAME bash -c " +echo 'Creating admin user...' +magento admin:user:create --admin-user='$ADMIN_USER' --admin-password='$ADMIN_PASSWORD' --admin-email='$ADMIN_EMAIL' + +if [ \$? -eq 0 ]; then + echo 'Admin user creation successful!' +else + echo 'Failed to create the admin user.' +fi +" + +echo "Script execution completed." +