Skip to content

Commit

Permalink
feat: YASSG default (#10)
Browse files Browse the repository at this point in the history
* infra: migrate to sigwin/infra, make prod dep

* fix: load common

* fix: add labels for build and start
  • Loading branch information
dkarlovi authored May 2, 2022
1 parent 7d8a540 commit a854888
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions resources/YASSG/default.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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

0 comments on commit a854888

Please sign in to comment.