-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
ifndef APP_ROOT | ||
$(error APP_ROOT must be defined before loading YASSG/common.mk) | ||
endif | ||
|
||
APP_PORT ?= 9988 | ||
BUILD_DIR ?= public | ||
BUILD_OPTS ?= | ||
BASE_URL ?= file://localhost${APP_ROOT}/${BUILD_DIR} | ||
|
||
start/dev: dev ## Start app in "dev" mode | ||
dev: clean | ||
@make dev/assets dev/server -j2 | ||
dev/server: vendor index.php | ||
symfony server:start --no-tls --document-root=. --port=${APP_PORT} | ||
dev/assets: node_modules | ||
node_modules/.bin/encore dev-server | ||
index.php: | ||
ln -s vendor/sigwin/yassg/web/index.php | ||
|
||
build: ${BUILD_DIR}/assets/entrypoints.json vendor ## Build app for "prod" target | ||
php vendor/sigwin/yassg/bin/yassg yassg:generate --env prod $(BASE_URL) ${BUILD_OPTS} | ||
.PHONY: build | ||
|
||
${BUILD_DIR}: | ||
mkdir -p ${BUILD_DIR} | ||
${BUILD_DIR}/assets/entrypoints.json: | ${BUILD_DIR} node_modules | ||
BASE_URL=${BASE_URL} node_modules/.bin/encore production | ||
|
||
clean: | ||
rm -rf var/cache/* var/log/* ${BUILD_DIR} | ||
.PHONY: clean | ||
node_modules: | ||
npm install | ||
vendor: | ||
composer install |
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,24 @@ | ||
SIGWIN_INFRA_ROOT := $(dir $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))) | ||
include ${SIGWIN_INFRA_ROOT}/PHP/library.mk | ||
include ${SIGWIN_INFRA_ROOT}/YASSG/common.mk | ||
|
||
ifndef LYCHEE_DOCKER_IMAGE | ||
LYCHEE_DOCKER_IMAGE=lycheeverse/lychee:20220118134522908286 | ||
endif | ||
|
||
ifndef LYCHEE_DOCKER_COMMAND | ||
LYCHEE_DOCKER_COMMAND=docker run --init --interactive ${TTY} --rm --user "$(shell id -u):$(shell id -g)" --volume "$(shell pwd):/project:ro" --workdir /project ${LYCHEE_DOCKER_IMAGE} | ||
endif | ||
|
||
self/check: analyze/composer analyze/cs analyze/phpstan analyze/psalm check | ||
ci/check: analyze/composer analyze/cs analyze/phpstan analyze/psalm lychee | ||
|
||
check: hack | ||
@make lychee | ||
|
||
hack: | ||
# TODO: hack until this can be done natively by the tool | ||
php -r '$$u=rtrim(parse_url("${BASE_URL}",PHP_URL_PATH),"/");if($$u!==null&&$$u!==""&&$$u!=="/"){$$p=dirname("./${BUILD_DIR}".$$u);if(!file_exists($$p)){mkdir($$p,0755,true);}symlink(str_repeat("../",substr_count($$u,"/")-1)?:"./",$$p."/".basename($$u));}' | ||
|
||
lychee: | ||
sh -c "${LYCHEE_DOCKER_COMMAND} --offline --base ./public ./public" |
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,38 +1,3 @@ | ||
ifndef APP_ROOT | ||
$(error APP_ROOT must be defined before loading YASSG/default.mk) | ||
endif | ||
ifndef SIGWIN_INFRA_ROOT | ||
SIGWIN_INFRA_ROOT := $(dir $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))) | ||
endif | ||
include ${SIGWIN_INFRA_ROOT}/Common/default.mk | ||
APP_PORT ?= 9988 | ||
BUILD_DIR ?= public | ||
BUILD_OPTS ?= | ||
BASE_URL ?= file://localhost${APP_ROOT}/${BUILD_DIR} | ||
|
||
start/dev: dev ## Start app in "dev" mode | ||
dev: clean | ||
@make dev/assets dev/server -j2 | ||
dev/server: vendor index.php | ||
symfony server:start --no-tls --document-root=. --port=${APP_PORT} | ||
dev/assets: node_modules | ||
node_modules/.bin/encore dev-server | ||
index.php: | ||
ln -s vendor/sigwin/yassg/web/index.php | ||
|
||
build: ${BUILD_DIR}/assets/entrypoints.json vendor ## Build app for "prod" target | ||
php vendor/sigwin/yassg/bin/yassg yassg:generate --env prod $(BASE_URL) ${BUILD_OPTS} | ||
.PHONY: build | ||
|
||
${BUILD_DIR}: | ||
mkdir -p ${BUILD_DIR} | ||
${BUILD_DIR}/assets/entrypoints.json: | ${BUILD_DIR} node_modules | ||
BASE_URL=${BASE_URL} node_modules/.bin/encore production | ||
|
||
clean: | ||
rm -rf var/cache/* var/log/* ${BUILD_DIR} | ||
.PHONY: clean | ||
node_modules: | ||
npm install | ||
vendor: | ||
composer install | ||
include ${SIGWIN_INFRA_ROOT}/PHP/library.mk | ||
include ${SIGWIN_INFRA_ROOT}/YASSG/common.mk |