Skip to content

Commit

Permalink
Script improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k3lm committed Sep 24, 2024
1 parent d193acd commit 7e7e309
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docker-compose.override.yml
.composer_cache
.env
default.vcl
id_rsa
3 changes: 1 addition & 2 deletions bin/install-sampledata
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
echo " Installing sample data..."
docker compose exec -u daemon -w /bitnami/magento magento bash rm -rf var/di/* var/generation/*
docker compose exec -u daemon -w /bitnami/magento magento bin/magento deploy:mode:set developer
docker compose exec -w /bitnami/magento magento bash -c "rm -rf var/di/* var/generation/*"
docker compose exec -u daemon -w /bitnami/magento magento bin/magento sampledata:deploy
docker compose exec -u daemon -w /bitnami/magento magento bin/magento setup:upgrade
docker compose exec -u daemon -w /bitnami/magento magento bin/magento cache:clean
Expand Down
6 changes: 5 additions & 1 deletion bin/shell
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
#!/bin/bash
docker compose exec -u daemon -w /bitnami/magento magento bash -c "$@"
if [ -z "$1" ]; then
docker compose exec -u daemon -w /bitnami/magento magento bash
else
docker compose exec -u daemon -w /bitnami/magento magento bash -c "$@"
fi
2 changes: 2 additions & 0 deletions bin/xdebug
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker compose exec magento /docker-entrypoint-init.d/xdebug.sh
3 changes: 3 additions & 0 deletions docker-entrypoint-init.d/00-set-developper-mode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd /bitnami/magento/ || exit 0
bin/magento deploy:mode:set developer
5 changes: 5 additions & 0 deletions docker-entrypoint-init.d/01-set-order_sequence.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
echo \
"ALTER TABLE sequence_order_0 AUTO_INCREMENT = $(date +%s);" \
"ALTER TABLE sequence_order_1 AUTO_INCREMENT = $(date +%s);" | \
mysql -h $MAGENTO_DATABASE_HOST -P $MAGENTO_DATABASE_PORT_NUMBER -u $MAGENTO_DATABASE_USER $MAGENTO_DATABASE_NAME
8 changes: 0 additions & 8 deletions docker-entrypoint-init.d/install-sequra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ cd /bitnami/magento/ || exit 0
if [ "$SQ_M2_CORE_VERSION" = "local" ]; then
php ./vendor/bin/composer config repositories.sequra/magento2-core path /Sequra/Core
COMPOSER_MIRROR_PATH_REPOS=1 php ./vendor/bin/composer require sequra/magento2-core:^2.5
# mkdir -p ./app/code
# ln -s /Sequra ./app/code/Sequra
# composer update
else
composer require sequra/magento2-core:"$SQ_M2_CORE_VERSION"
fi
Expand All @@ -16,11 +13,6 @@ composer require mageplaza/magento-2-spanish-language-pack:dev-master \
mageplaza/magento-2-french-language-pack:dev-master \
mageplaza/magento-2-italian-language-pack:dev-master;
bin/magento config:set dev/template/allow_symlink 1
# bin/magento config:set general/locale/code "$MAGENTO_LOCALE"
# bin/magento config:set general/locale/timezone "$MAGENTO_TIMEZONE"
# bin/magento config:set general/country/default "$MAGENTO_COUNTRY"
# bin/magento config:set currency/options/base "$MAGENTO_CURRENCY"
# bin/magento config:set currency/options/default "$MAGENTO_CURRENCY"
bin/magento module:enable Sequra_Core
bin/magento deploy:mode:set developer
bin/magento setup:upgrade
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
if [ $PHP_XDEBUG_ENABLED == 'yes' ]; then
echo "Installing xdebug"
apt-get update
apt-get install -y --no-install-recommends php-xdebug
if [ -e /opt/bitnami/php/etc/conf.d/xdebug.ini ]; then
echo "Disabling xdebug"
rm -f /opt/bitnami/php/etc/conf.d/xdebug.ini
else
echo "Enabling xdebug"
cat <<EOF> /opt/bitnami/php/etc/conf.d/xdebug.ini
zend_extension = xdebug.so
Expand All @@ -12,7 +13,5 @@ xdebug.discover_client_host = 0
xdebug.client_port = 9003
xdebug.client_host=host.docker.internal
EOF
else
echo "Skip xdebug installation"
fi
fi
/opt/bitnami/scripts/php/reload.sh
3 changes: 2 additions & 1 deletion teardown.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/bash
docker compose down -v
docker-compose down --rmi all --volumes --remove-orphans
docker system prune -a

0 comments on commit 7e7e309

Please sign in to comment.