-
Notifications
You must be signed in to change notification settings - Fork 32
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
1 parent
cfd53a3
commit 241eacb
Showing
5 changed files
with
109 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 |
---|---|---|
|
@@ -11,7 +11,7 @@ [email protected] | |
PROJECT_INSTALL= | ||
IMAGE_PHP=skilldlabs/php:73-fpm | ||
IMAGE_NGINX=skilldlabs/nginx:1.16 | ||
IMAGE_FRONT=skilldlabs/frontend:zen | ||
IMAGE_FRONT=node:lts-alpine | ||
IMAGE_DRIVER=zenika/alpine-chrome | ||
ADD_PHP_EXT= | ||
MAIN_DOMAIN_NAME=docker.localhost | ||
|
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
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
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
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,15 +1,40 @@ | ||
# Execute front container function | ||
front = docker run --rm -u $(CUID):$(CGID) -v $(shell pwd)/web/themes/custom/$(THEME_NAME):/work $(IMAGE_FRONT) ${1} | ||
# Evaluate recursively. | ||
CUID ?= $(LOCAL_UID) | ||
CGID ?= $(LOCAL_GID) | ||
CLEAR_FRONT_PACKAGES?=yes | ||
FRONT_PORT?=65200 | ||
|
||
# Execute front container function. | ||
front = docker run \ | ||
--rm \ | ||
--init \ | ||
-p $(FRONT_PORT):$(FRONT_PORT) \ | ||
-u $(CUID):$(CGID) \ | ||
-v $(shell pwd)/web/themes/custom/$(THEME_NAME):/app \ | ||
--workdir /app \ | ||
$(IMAGE_FRONT) ${1} | ||
|
||
clear-front: | ||
ifeq ($(CLEAR_FRONT_PACKAGES), yes) | ||
@echo "Clean of node_modules... To skip this action please set CLEAR_FRONT_PACKAGES=no in .env file" | ||
$(call front, rm -rf /app/node_modules) | ||
endif | ||
|
||
## Build front tasks | ||
front: | ||
@echo "Building front tasks..." | ||
@echo "Running front tasks..." | ||
docker pull $(IMAGE_FRONT) | ||
$(call front, bower install) | ||
$(call front) | ||
$(call php-0, rm -rf web/themes/custom/$(THEME_NAME)/node_modules) | ||
$(call front, yarn install --prod --ignore-optional --check-files) | ||
$(call front, yarn build --verbose) | ||
make clear-front | ||
|
||
lint: | ||
@echo "Running linters..." | ||
$(call front, gulp lint) | ||
$(call php-0, rm -rf web/themes/custom/$(THEME_NAME)/node_modules) | ||
@echo "Running theme linters with fix..." | ||
docker pull $(IMAGE_FRONT) | ||
$(call front, yarn install --prod --ignore-optional --check-files) | ||
$(call front, yarn lint-fix) | ||
|
||
storybook: | ||
@echo "Running storybook..." | ||
docker pull $(IMAGE_FRONT) | ||
$(call front, yarn install --ignore-optional --check-files) | ||
$(call front, yarn storybook -p $(FRONT_PORT)) |