Рефакторинг задач мейкфайла
This commit is contained in:
parent
e4c9dc50e3
commit
7166a56968
63
Makefile
63
Makefile
@ -1,61 +1,74 @@
|
|||||||
|
APP_ENV := dev
|
||||||
|
APP_OUTPUT_DIR := output_dev
|
||||||
|
APP_URL := https://vakhrushev.me
|
||||||
|
APP_NPM_BUILD_CMD := build
|
||||||
|
|
||||||
|
ifeq ($(TARGET), prod)
|
||||||
|
APP_ENV := prod
|
||||||
|
APP_OUTPUT_DIR := output_prod
|
||||||
|
APP_URL :=
|
||||||
|
APP_NPM_BUILD_CMD := build-prod
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
install: build-docker install-php-deps install-js-deps
|
install: build-docker install-php-deps install-js-deps
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
./tools/build-docker
|
./tools/build-docker
|
||||||
|
|
||||||
clean-dev:
|
|
||||||
rm -rf ./output_dev/*
|
|
||||||
|
|
||||||
install-php-deps:
|
install-php-deps:
|
||||||
tools/composer install -n
|
./tools/composer install -n
|
||||||
|
|
||||||
install-js-deps:
|
install-js-deps:
|
||||||
tools/npm ci
|
./tools/npm ci
|
||||||
|
|
||||||
clean-prod:
|
# Building
|
||||||
rm -rf ./output_prod/*
|
|
||||||
|
|
||||||
build-assets-dev:
|
clean:
|
||||||
./tools/npm run build
|
rm -rf ./${APP_OUTPUT_DIR}/*
|
||||||
|
|
||||||
build-assets-prod:
|
build-assets:
|
||||||
./tools/npm run build-prod
|
./tools/npm run "${APP_NPM_BUILD_CMD}"
|
||||||
|
|
||||||
build-site-dev:
|
build-site:
|
||||||
./tools/sculpin generate \
|
./tools/sculpin generate \
|
||||||
--env=dev \
|
--env="${APP_ENV}" \
|
||||||
|
--url="${APP_URL}" \
|
||||||
--no-interaction \
|
--no-interaction \
|
||||||
-vv
|
-vv
|
||||||
|
|
||||||
build-site-prod:
|
build: clean build-assets build-site
|
||||||
./tools/sculpin generate \
|
|
||||||
--env=prod \
|
|
||||||
--url="https://vakhrushev.me" \
|
|
||||||
--no-interaction \
|
|
||||||
-vv
|
|
||||||
|
|
||||||
build-dev: clean-dev build-assets-dev build-site-dev
|
build-prod:
|
||||||
|
$(MAKE) build TARGET=prod
|
||||||
|
|
||||||
build-prod: clean-prod build-assets-prod build-site-prod
|
# Format
|
||||||
|
|
||||||
format:
|
format-pages:
|
||||||
|
./tools/npm run format-md
|
||||||
|
|
||||||
|
format-assets:
|
||||||
./tools/npm run format-webpack
|
./tools/npm run format-webpack
|
||||||
./tools/npm run format-js
|
./tools/npm run format-js
|
||||||
./tools/npm run format-vue
|
./tools/npm run format-vue
|
||||||
./tools/npm run format-style
|
./tools/npm run format-style
|
||||||
./tools/npm run format-md
|
|
||||||
|
|
||||||
format-php:
|
format-php:
|
||||||
./tools/php-cs-fixer fix
|
./tools/php-cs-fixer fix
|
||||||
|
|
||||||
watch: build-assets-dev
|
format: format-pages format-assets format-php
|
||||||
|
|
||||||
|
watch: build-assets
|
||||||
./tools/sculpin generate \
|
./tools/sculpin generate \
|
||||||
--env=dev \
|
--env="${APP_ENV}" \
|
||||||
--watch \
|
--watch \
|
||||||
--server \
|
--server \
|
||||||
--port=8000 \
|
--port=8000 \
|
||||||
--no-interaction
|
--no-interaction
|
||||||
|
|
||||||
|
# Deploy
|
||||||
|
|
||||||
deploy: build-prod
|
deploy: build-prod
|
||||||
./tools/dep deploy production -vv
|
./tools/dep deploy production -vv
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user