Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
r-martins committed Apr 18, 2022
2 parents b4b12a6 + 3b3b881 commit 2c1f5aa
Show file tree
Hide file tree
Showing 33 changed files with 9,537 additions and 8,770 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
.vscode
.idea
.DS_Store
src/
193 changes: 193 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
SHELL := /bin/bash

args = `arg="$(filter-out $(firstword $(MAKECMDGOALS)),$(MAKECMDGOALS))" && echo $${arg:-${1}}`

green = $(shell printf "\e[32;01m$1\e[0m")
yellow = $(shell printf "\e[33;01m$1\e[0m")
red = $(shell printf "\e[33;31m$1\e[0m")

format = $(shell printf "%-40s %s" "$(call green,bin/$1)" $2)

comma:= ,

.DEFAULT_GOAL:=help

%:
@:

help:
@echo ""
@echo "$(call yellow,Use the following CLI commands:)"
@echo "$(call red,===============================)"
@echo "$(call format,bash,'Drop into the bash prompt of your Docker container.')"
@echo "$(call format,cache-clean,'Access the cache-clean CLI.')"
@echo "$(call format,cli,'Run any CLI command without going into the bash prompt.')"
@echo "$(call format,clinotty,'Run any CLI command with no TTY.')"
@echo "$(call format,cliq,'Run any CLI command but pipe all output to /dev/null.')"
@echo "$(call format,composer,'Run the composer binary.')"
@echo "$(call format,copyfromcontainer,'Copy folders or files from container to host.')"
@echo "$(call format,copytocontainer,'Copy folders or files from host to container.')"
@echo "$(call format,cron,'Start or stop the cron service.')"
@echo "$(call format,dev-urn-catalog-generate,'Generate URNs for PHPStorm and remap paths to local host.')"
@echo "$(call format,devconsole,'Alias for n98-magerun2 dev:console.')"
@echo "$(call format,devtools-cli-check,'Check & install the CLI devtools if missing from system.')"
@echo "$(call format,download,'Download & extract specific Magento version to the src directory.')"
@echo "$(call format,fixowns,'This will fix filesystem ownerships within the container.')"
@echo "$(call format,fixperms,'This will fix filesystem permissions within the container.')"
@echo "$(call format,grunt,'Run the grunt binary.')"
@echo "$(call format,magento,'Run the Magento CLI.')"
@echo "$(call format,mftf,'Run the Magento MFTF.')"
@echo "$(call format,mysql,'Run the MySQL CLI with database config from env/db.env.')"
@echo "$(call format,mysqldump,'Backup the Magento database.')"
@echo "$(call format,n98-magerun2,'Access the n98-magerun2 CLI.')"
@echo "$(call format,node,'Run the node binary.')"
@echo "$(call format,npm,'Run the npm binary.')"
@echo "$(call format,pwa-studio,'(BETA) Start the PWA Studio server.')"
@echo "$(call format,redis,'Run a command from the redis container.')"
@echo "$(call format,remove,'Remove all containers.')"
@echo "$(call format,removeall,'Remove all containers$(comma) networks$(comma) volumes and images.')"
@echo "$(call format,removevolumes,'Remove all volumes.')"
@echo "$(call format,restart,'Stop and then start all containers.')"
@echo "$(call format,root,'Run any CLI command as root without going into the bash prompt.')"
@echo "$(call format,rootnotty,'Run any CLI command as root with no TTY.')"
@echo "$(call format,setup,'Run the Magento setup process$(comma) with optional domain name.')"
@echo "$(call format,setup-composer-auth,'Setup authentication credentials for Composer.')"
@echo "$(call format,setup-domain,'Setup Magento domain name.')"
@echo "$(call format,setup-grunt,'Install and configure Grunt JavaScript task runner.')"
@echo "$(call format,setup-pwa-studio,'(BETA) Install PWA Studio.')"
@echo "$(call format,setup-ssl,'Generate an SSL certificate for one or more domains.')"
@echo "$(call format,setup-ssl-ca,'Generate a certificate authority and copy it to the host.')"
@echo "$(call format,start,'Start all containers.')"
@echo "$(call format,status,'Check the container status.')"
@echo "$(call format,stop,'Stop all containers.')"
@echo "$(call format,update,'Update your project to the latest version of docker-magento.')"
@echo "$(call format,xdebug,'Disable or enable Xdebug.')"

bash:
@./bin/bash

cache-clean:
@./bin/cache-clean $(call args)

cli:
@./bin/cli $(call args)

clinotty:
@./bin/clinotty $(call args)

cliq:
@./bin/cliq $(call args)

composer:
@./bin/composer $(call args)

copyfromcontainer:
@./bin/copyfromcontainer $(call args)

copytocontainer:
@./bin/copytocontainer $(call args)

cron:
@./bin/cron $(call args)

dev-urn-catalog-generate:
@./bin/dev-urn-catalog-generate

devconsole:
@./bin/devconsole

devtools-cli-check:
@./bin/devtools-cli-check

download:
@./bin/download $(call args)

fixowns:
@./bin/fixowns $(call args)

fixperms:
@./bin/fixperms $(call args)

grunt:
@./bin/grunt $(call args)

magento:
@./bin/magento $(call args)

mftf:
@./bin/mftf $(call args)

mysql:
@./bin/mysql $(call args)

mysqldump:
@./bin/mysqldump $(call args)

n98-magerun2:
@./bin/n98-magerun2 $(call args)

node:
@./bin/node $(call args)

npm:
@./bin/npm $(call args)

pwa-studio:
@./bin/pwa-studio

redis:
@./bin/redis $(call args)

remove:
@./bin/remove

removeall:
@./bin/removeall

removevolumes:
@./bin/removevolumes

restart:
@./bin/restart $(call args)

root:
@./bin/root $(call args)

rootnotty:
@./bin/rootnotty $(call args)

setup:
@./bin/setup $(call args)

setup-composer-auth:
@./bin/setup-composer-auth

setup-domain:
@./bin/setup-domain $(call args)

setup-grunt:
@./bin/setup-grunt

setup-pwa-studio:
@./bin/setup-pwa-studio $(call args)

setup-ssl:
@./bin/setup-ssl $(call args)

setup-ssl-ca:
@./bin/setup-ssl-ca

start:
@./bin/start $(call args)

status:
@./bin/status

stop:
@./bin/stop $(call args)

update:
@./bin/update

xdebug:
@./bin/xdebug $(call args)
23 changes: 22 additions & 1 deletion bin/cache-clean
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
1 change: 1 addition & 0 deletions bin/clinotty
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 "$@"
3 changes: 2 additions & 1 deletion bin/cliq
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
5 changes: 5 additions & 0 deletions bin/cron
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
1 change: 1 addition & 0 deletions bin/dev-urn-catalog-generate
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
bin/magento dev:urn-catalog:generate misc.xml
bin/copyfromcontainer misc.xml
mkdir -p src/.idea
mv src/misc.xml src/.idea/misc.xml

echo "URN's have been generated, you may now restart PHPStorm"
2 changes: 1 addition & 1 deletion bin/devconsole
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
bin/cli bin/n98-magerun2.phar dev:console
bin/n98-magerun2 dev:console
3 changes: 1 addition & 2 deletions bin/download
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
set -o errexit

VERSION=${1:-2.4.2}
VERSION=${1:-2.4.3-p1}
EDITION=${2:-community}

bin/stop
Expand Down
2 changes: 2 additions & 0 deletions bin/mftf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
bin/clinotty vendor/bin/mftf "$@"
15 changes: 11 additions & 4 deletions bin/n98-magerun2
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
#!/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

bin/cli bin/n98-magerun2.phar "$@"
2 changes: 1 addition & 1 deletion bin/remove
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm --stop
docker-compose -f docker-compose.yml -f docker-compose.dev.yml rm
Loading

0 comments on commit 2c1f5aa

Please sign in to comment.