103 lines
3.0 KiB
Makefile
103 lines
3.0 KiB
Makefile
#!/usr/bin/make
|
|
|
|
SHELL = /bin/sh
|
|
|
|
USER_UID := $(shell id -u)
|
|
USER_UNAME := $(shell id -un)
|
|
USER_GID := $(shell id -g)
|
|
USER_GNAME := $(shell id -gn)
|
|
DATE_NOW := $(shell date '+%Y-%m-%d_%H%M%S')
|
|
|
|
export USER_UID
|
|
export USER_UNAME
|
|
export USER_GID
|
|
export USER_GNAME
|
|
# export DATE_NOW
|
|
|
|
|
|
pull:
|
|
docker-compose pull
|
|
|
|
build:
|
|
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
|
|
|
|
buildnc:
|
|
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME)
|
|
|
|
buildnc_mysql:
|
|
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) mysql
|
|
|
|
buildnc_nginx:
|
|
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) nginx
|
|
|
|
downbuildup: down build up
|
|
|
|
up:
|
|
docker-compose up -d
|
|
|
|
ps:
|
|
docker-compose ps
|
|
|
|
logs:
|
|
docker-compose logs -f
|
|
|
|
maj_config: crd composer_install updb cim cr pag #dev.phpmyadmin.leshed.fr
|
|
|
|
crd:
|
|
docker exec leshed-php-1 /bin/bash -c "drush cache-clear drush"
|
|
|
|
composer_install:
|
|
docker exec leshed-php-1 /bin/bash -c "composer install --no-dev"
|
|
|
|
updb:
|
|
docker exec leshed-php-1 /bin/bash -c "drush updb -y"
|
|
|
|
cim:
|
|
docker exec leshed-php-1 /bin/bash -c "drush config-import -y"
|
|
|
|
# sync_struct:
|
|
# docker exec leshed-php-1 /bin/bash -c "drush im --choice safe && drush ib --choice full"
|
|
|
|
cr:
|
|
docker exec leshed-php-1 /bin/bash -c "drush cr"
|
|
|
|
pag:
|
|
docker exec leshed-php-1 /bin/bash -c "drush pag all canonical_entities:node && drush pag all canonical_entities:taxonomy_term"
|
|
|
|
restart_nginx:
|
|
docker-compose restart nginx
|
|
|
|
restart_php:
|
|
docker-compose restart php
|
|
|
|
down:
|
|
docker-compose down
|
|
|
|
exec_nginx:
|
|
docker exec -it leshed-nginx-1 bash
|
|
|
|
exec_php:
|
|
docker exec -it leshed-php-1 bash
|
|
|
|
exec_mysql:
|
|
docker exec -it leshed-mysql-1 bash
|
|
|
|
dump_db:
|
|
docker exec leshed-mysql-1 sh -c 'exec mariadb-dump -uroot -pleshed leshed' > ./ressources/leshed-$(DATE_NOW)-local.sql
|
|
|
|
# Test sur mobile : connexion ADB sans fil + tunnel vers le serveur Vite (HMR).
|
|
# Le port du débogage sans fil change à chaque activation : on le passe
|
|
# (make mobile MOBILE=192.168.1.101:37495) ou on le laisse trouver par nmap.
|
|
# L'appareil doit avoir été associé une fois (adb pair IP:PORT CODE).
|
|
MOBILE ?= 192.168.1.101
|
|
|
|
mobile:
|
|
@target="$(MOBILE)"; \
|
|
case "$$target" in *:*) ;; *) \
|
|
port=$$(nmap -Pn -p 30000-50000 --min-rate 3000 -T4 "$$target" | awk -F/ '/open/ {print $$1; exit}'); \
|
|
[ -n "$$port" ] || { echo "Aucun port ADB trouvé sur $$target (débogage sans fil actif ?)"; exit 1; }; \
|
|
target="$$target:$$port";; \
|
|
esac; \
|
|
adb connect "$$target" && adb -s "$$target" reverse tcp:5173 tcp:5173 && \
|
|
echo "OK : $$target, localhost:5173 du mobile -> Vite du laptop. Firefox : about:debugging"
|