소스 검색

Merge pull request #235 from rangerz/n98-magerun2

Updated mysql, n98-magerun2, and setup
Mark Shust 5 년 전
부모
커밋
38075fedef
4개의 변경된 파일11개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 1
      README.md
  2. 2 1
      compose/bin/mysql
  3. 6 0
      compose/bin/n98-magerun2
  4. 1 5
      compose/bin/setup

+ 2 - 1
README.md

@@ -1,4 +1,4 @@
-<h1 align="center">markshust/docker-magento</h1> 
+<h1 align="center">markshust/docker-magento</h1>
 
 <div align="center">
   <p>Mark Shust's Docker Configuration for Magento</p>
@@ -214,6 +214,7 @@ You'll now have an updated `bin/update` helper script, and can run it to update
 - `bin/fixperms`: This will fix filesystem permissions within the container.
 - `bin/grunt`: Run the grunt binary. Ex. `bin/grunt exec`
 - `bin/magento`: Run the Magento CLI. Ex: `bin/magento cache:flush`
+- `bin/mysql`: Run the MySQL CLI with database config from env/db.env. Ex `bin/mysql -e "EXPLAIN core_config_data"`
 - `bin/n98-magerun2`: Access the n98 magerun CLI. Ex: `bin/n98-magerun2 dev:console`
 - `bin/node`: Run the node binary. Ex. `bin/node --version`
 - `bin/npm`: Run the npm binary. Ex. `bin/npm install`

+ 2 - 1
compose/bin/mysql

@@ -1,2 +1,3 @@
 #!/bin/bash
-bin/cli mysql -hdb -umagento -pmagento magento "$@"
+source env/db.env
+bin/cli mysql -hdb -u${MYSQL_USER} -p${MYSQL_PASSWORD} ${MYSQL_DATABASE} "$@"

+ 6 - 0
compose/bin/n98-magerun2

@@ -1,2 +1,8 @@
 #!/bin/bash
+if ! bin/clinotty ls bin/n98-magerun2.phar 1> /dev/null 2>&1; then
+    bin/clinotty curl -O https://files.magerun.net/n98-magerun2.phar
+    bin/clinotty chmod +x n98-magerun2.phar
+    bin/clinotty mkdir -p bin
+    bin/clinotty mv n98-magerun2.phar bin/n98-magerun2.phar
+fi
 bin/cli bin/n98-magerun2.phar "$@"

+ 1 - 5
compose/bin/setup

@@ -9,10 +9,6 @@ sed -e 's/5f5929ef9f2ec4ca048a2add261d22c92807630f/ce31e720d60451784b9fdb3769e43
 docker-compose -f docker-compose.yml up -d
 sleep 1 #Ensure containers are started...
 
-curl -O https://files.magerun.net/n98-magerun2.phar
-chmod +x n98-magerun2.phar
-mv n98-magerun2.phar src/bin/n98-magerun2.phar
-
 echo "Copying all files from host to container..."
 rm -rf src/vendor #Clear for step below
 bin/copytocontainer --all
@@ -80,7 +76,7 @@ bin/clinotty bin/magento deploy:mode:set developer
 bin/clinotty bin/magento indexer:reindex
 
 echo "Forcing deploy of static content to speed up initial requests..."
-bin/clinotty bin/magento setup:static-content:deploy -f 
+bin/clinotty bin/magento setup:static-content:deploy -f
 
 echo "Enabling Redis for cache..."
 bin/clinotty bin/magento setup:config:set --no-interaction --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0