Use make for calling various scripts correctly.

This commit is contained in:
flash 2025-04-11 18:56:49 +00:00
parent 0d8283495d
commit 4da099ca74
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
4 changed files with 56 additions and 7 deletions

52
Makefile Normal file
View file

@ -0,0 +1,52 @@
PHP_EXE := $(shell which php8.4)
COMPOSER_EXE := $(shell which composer)
NODE_EXE := $(shell which node)
NPM_EXE := $(shell which npm)
SUDO_EXE := $(shell which sudo)
GIT_EXE := $(shell which git)
WWW_USER := www-data
BUILD_EXE := build.js
ENV_FILE := .env
TOOLS_DIR := tools
VENDOR_DIR := vendor
all: update migrate clear-cache build cron
update: composer npm
composer:
${PHP_EXE} ${COMPOSER_EXE} update
npm:
${NPM_EXE} update --save
migrate:
${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/migrate
clear-cache:
${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/nuke-tpl-cache
cron:
${SUDO_EXE} -u ${WWW_USER} ${PHP_EXE} ${TOOLS_DIR}/cron slow
build:
${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE}
rebuild-css:
${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} css
rebuild-js:
${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} js
rebuild-twig:
${NODE_EXE} --env-file ${ENV_FILE} ${BUILD_EXE} twig
analyse:
${PHP_EXE} ${VENDOR_DIR}/bin/phpstan
tag: analyse
${PHP_EXE} ${TOOLS_DIR}/create-tag
${GIT_EXE} push
.PHONY: all update composer npm build rebuild-css rebuild-js rebuild-twig migrate clear-cache cron analyse tag