-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from shochdoerfer/feature/optimize_docker
Fix Docker setup issues for development
- Loading branch information
Showing
18 changed files
with
159 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
#!/bin/bash | ||
bin/cli /var/www/.composer-global/vendor/bin/cache-clean.js "$@" | ||
COMPOSER_GLOBAL=/var/www/.composer-global | ||
CACHE_CLEAN=${COMPOSER_GLOBAL}/vendor/bin/cache-clean.js | ||
|
||
if ! bin/cliq ls $CACHE_CLEAN; then | ||
echo "Installing devtools metapackage, just a moment..." | ||
bin/cliq mkdir -p ${COMPOSER_GLOBAL} | ||
bin/composer require --working-dir=${COMPOSER_GLOBAL} --quiet markshust/magento2-metapackage-devtools-cli:^1.0 | ||
echo "Devtools installed." | ||
fi | ||
|
||
if [ "$1" == "--watch" ]; then | ||
# Kill duplicate watch process | ||
WATCH_PID=$(bin/clinotty ps -eaf | grep "$CACHE_CLEAN --quiet --watch" | grep -v grep | awk '{print $2}') | ||
if [[ "" != "$WATCH_PID" ]]; then | ||
bin/cliq kill -9 "$WATCH_PID" | ||
fi | ||
|
||
# Run watch mode in the background | ||
bin/cliq $CACHE_CLEAN --quiet --watch & | ||
else | ||
bin/cli $CACHE_CLEAN "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bin/cli /var/www/.n98-magerun2/modules/magerun2-list-api-endpoints/vendor/bin/captainhook "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit | ||
# -T: Disable pseudo-tty allocation | ||
docker-compose exec -T phpfpm "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit | ||
bin/clinotty "$@" >/dev/null | ||
# Without stdout and stderr | ||
bin/clinotty "$@" >/dev/null 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit | ||
bin/root service cron "$@" | ||
bin/root touch /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status | ||
bin/root chown app:app /var/www/html/var/.setup_cronjob_status /var/www/html/var/.update_cronjob_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
# This script will be called from the Git Hooks on the host and redirect the CaptainHookPHP commands into the phpfpm | ||
# container. For some odd reason it was needed to change the working directory so that CaptainHookPHP can resolve paths | ||
# properly | ||
[ -z "$1" ] && echo "Please specify a CLI command (ex. ls)" && exit | ||
# make sure the phpfpm container is running before trying to execute the git hook | ||
docker-compose up --no-recreate -d phpfpm | ||
docker-compose exec -w /var/www/.n98-magerun2/modules/magerun2-list-api-endpoints/ -T phpfpm "$@" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
bin/clinotty vendor/bin/mftf "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
#!/bin/bash | ||
if ! bin/clinotty ls bin/n98-magerun2.phar 1> /dev/null 2>&1; then | ||
bin/clinotty mkdir -p bin | ||
bin/clinotty curl https://files.magerun.net/n98-magerun2.phar -o bin/n98-magerun2.phar | ||
bin/clinotty chmod +x bin/n98-magerun2.phar | ||
if ! bin/cliq ls bin/n98-magerun2.phar; then | ||
echo "Downloading n98-magerun2.phar, just a moment..." | ||
bin/clinotty curl -sS -O https://files.magerun.net/n98-magerun2.phar | ||
bin/clinotty curl -sS -o n98-magerun2.phar.sha256 https://files.magerun.net/sha256.php?file=n98-magerun2.phar | ||
bin/clinotty shasum -a 256 -c n98-magerun2.phar.sha256 | ||
[ $? != 0 ] && echo "sha256 checksum do not match!" && exit | ||
|
||
bin/cliq chmod +x n98-magerun2.phar | ||
bin/cliq mkdir -p bin | ||
bin/cliq mv n98-magerun2.phar bin | ||
fi | ||
|
||
S=$(bin/cli cat /usr/local/etc/php/php.ini | grep -iGc 'xdebug.mode = off'); | ||
|
||
if [[ $S == 1 ]]; then | ||
bin/cli bin/n98-magerun2.phar "$@" | ||
else | ||
bin/cli php -dxdebug.mode=debug -dxdebug.start_with_request=yes bin/n98-magerun2.phar "$@" | ||
fi | ||
bin/cli bin/n98-magerun2.phar "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
set -o errexit | ||
|
||
[ -z "$1" ] && echo "Please specify a domain name (ex. magento.test)" && exit | ||
|
||
DOMAIN=$1 | ||
|
||
echo "Set https://${DOMAIN}/ to web/secure/base_url and web/secure/base_url" | ||
bin/magento config:set web/secure/base_url https://"$DOMAIN"/ | ||
bin/magento config:set web/unsecure/base_url https://"$DOMAIN"/ | ||
|
||
echo "Generating SSL certificate..." | ||
bin/setup-ssl "$DOMAIN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters