Skip to content

Commit fea825f

Browse files
author
Florian Horn
committed
Test environment Update to Magento 2.4.0
1 parent d81c605 commit fea825f

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

bin/setup

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
BASE_URL=${1:-m2.localhost}
3-
MAGE_VERSION=${2:-2.3.3}
3+
MAGE_VERSION=${2:-2.4.0}
44

55
# load the DB env information
66
DIR="${BASH_SOURCE%/*}"
@@ -11,7 +11,7 @@ bin/restart
1111
sleep 1 #Ensure containers are started...
1212

1313
echo "Downloading Magento ${MAGE_VERSION} with Sample data..."
14-
bin/root curl -o /var/www/html/magento.tar.gz http://pubfiles.nexcess.net/magento/ce-packages/magento2-with-samples-${MAGE_VERSION}.tar.gz
14+
bin/root curl -o /var/www/html/magento.tar.gz https://pubfiles.nexcess.net/magento/ce-packages/magento2-with-samples-${MAGE_VERSION}.tar.gz
1515
bin/rootnotty tar xvfz /var/www/html/magento.tar.gz
1616
bin/rootnotty rm /var/www/html/magento.tar.gz
1717
bin/rootnotty cp /var/www/html/nginx.conf.sample /var/www/html/nginx.conf
@@ -23,22 +23,27 @@ bin/root curl -o /usr/local/bin/magerun https://files.magerun.net/n98-magerun2-l
2323
bin/rootnotty chmod +x /usr/local/bin/magerun
2424

2525
echo "Forcing reinstall of composer deps to ensure perms & reqs..."
26-
bin/clinotty composer install
26+
bin/clinotty composer global require hirak/prestissimo
27+
bin/clinotty composer update
2728

2829
bin/clinotty bin/magento setup:install \
2930
--db-host=$MYSQL_HOST \
3031
--db-name=$MYSQL_DATABASE \
3132
--db-user=$MYSQL_USER \
3233
--db-password=$MYSQL_PASSWORD \
3334
--base-url=https://$BASE_URL/ \
35+
--base-url-secure=https://$BASE_URL/ \
36+
--backend-frontname=admin \
3437
--admin-firstname=Admin \
3538
--admin-lastname=User \
3639
--admin-email=admin@test.loc \
3740
--admin-user=magento \
3841
--admin-password=magento2\
39-
--language=de_DE \
42+
--language=en_US \
4043
--currency=EUR \
4144
--timezone=Europe/Berlin \
45+
--search-engine=elasticsearch7 \
46+
--elasticsearch-host=elasticsearch \
4247
--use-rewrites=1
4348

4449
echo "Turning on developer mode.."
@@ -48,6 +53,12 @@ bin/clinotty bin/magento indexer:reindex
4853
echo "Forcing deploy of static content to speed up initial requests..."
4954
bin/clinotty bin/magento setup:static-content:deploy -f
5055

56+
echo "Re-indexing with Elasticsearch..."
57+
bin/clinotty bin/magento indexer:reindex
58+
59+
echo "Disable Magento 2FAuth module..."
60+
bin/clinotty bin/magento module:disable Magento_TwoFactorAuth
61+
5162
echo "Clearing the cache for good measure..."
5263
bin/clinotty bin/magento cache:flush
5364

@@ -61,11 +72,13 @@ bin/clinotty composer require bitexpert/magento2-force-customer-login:*
6172
echo "Enabling Force Login module..."
6273
bin/clinotty bin/magento module:enable BitExpert_ForceCustomerLogin
6374
bin/clinotty bin/magento setup:upgrade
64-
bin/clinotty bin/magento setup:di:compile
6575

6676
echo "Installing Sample data..."
6777
bin/clinotty bin/magento sampledata:deploy
6878

79+
echo "Generating SSL certificate..."
80+
bin/setup-ssl $BASE_URL
81+
6982
echo "Restarting containers with host bind mounts for dev..."
7083
bin/restart
7184

bin/setup-ssl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
[ -z "$1" ] && echo "Please specify a domain (ex. mydomain.test)" && exit
3+
4+
# Generate certificate authority if not already setup
5+
if ! docker-compose exec -T -u root app cat /root/.local/share/mkcert/rootCA.pem | grep -q 'BEGIN CERTIFICATE'; then
6+
bin/setup-ssl-ca
7+
fi
8+
9+
# Generate the certificate for the specified domain
10+
docker-compose exec -T -u root app mkcert -key-file nginx.key -cert-file nginx.crt "$@"
11+
echo "Moving key and cert to /etc/nginx/certs/..."
12+
docker-compose exec -T -u root app chown app:app nginx.key nginx.crt
13+
docker-compose exec -T -u root app mv nginx.key nginx.crt /etc/nginx/certs/
14+
15+
# Restart nginx to apply the updates
16+
echo "Restarting containers to apply updates..."
17+
bin/restart

docker-compose.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ version: "3"
55

66
services:
77
app:
8-
image: markoshust/magento-nginx:1.13-7
8+
image: markoshust/magento-nginx:1.18
99
ports:
1010
- "80:8000"
1111
- "443:8443"
1212
links:
1313
- db
1414
- phpfpm
15+
- elasticsearch
1516
volumes: &appvolumes
1617
- ~/.composer:/var/www/.composer
1718
- ~/.composer/auth.json:/var/www/html/auth.json
@@ -49,11 +50,19 @@ services:
4950
- sockdata:/sock
5051

5152
phpfpm:
52-
image: markoshust/magento-php:7.2-fpm-0
53+
image: markoshust/magento-php:7.4-fpm
5354
links:
5455
- db
5556
volumes: *appvolumes
5657

58+
elasticsearch:
59+
image: markoshust/magento-elasticsearch:7.6.2-2
60+
ports:
61+
- "9200:9200"
62+
- "9300:9300"
63+
environment:
64+
- "discovery.type=single-node"
65+
5766
db:
5867
image: mysql:5.7
5968
ports:

0 commit comments

Comments
 (0)