Skip to content

Commit

Permalink
merged make all by param, disabled clean.
Browse files Browse the repository at this point in the history
  • Loading branch information
iberdinsky-skilld authored and koskinpark committed Nov 12, 2019
1 parent 241eacb commit 7e1de54
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
1 change: 1 addition & 0 deletions .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PROJECT_INSTALL=
IMAGE_PHP=skilldlabs/php:73-fpm
IMAGE_NGINX=skilldlabs/nginx:1.16
IMAGE_FRONT=node:lts-alpine
CLEAR_FRONT_PACKAGES=no
IMAGE_DRIVER=zenika/alpine-chrome
ADD_PHP_EXT=
MAIN_DOMAIN_NAME=docker.localhost
Expand Down
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ deploy:review:
- echo "INSTALL_DEV_DEPENDENCIES=TRUE" >> .env.default
- docker --version
- docker-compose --version
- make all_ci
- make all MAKE_ENV=ci
after_script:
- echo "Started ${CI_ENVIRONMENT_URL} composition in ${BUILD_DIR} from Makefile."
environment:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ endif
make -s down
@for i in $(DIRS); do if [ -d "$$i" ]; then echo "Removing $$i..."; docker run --rm -v $(shell pwd):/mnt $(IMAGE_PHP) sh -c "rm -rf /mnt/$$i"; fi; done
if [ -d $(DB_DATA_DIR) ]; then echo "Removing mysql data $(DB_DATA_DIR) ..."; docker run --rm --user 0:0 -v $(shell pwd):/mnt/2rm $(IMAGE_PHP) sh -c "rm -rf /mnt/2rm/$(DB_DATA_DIR)"; fi
ifeq ($(CLEAR_FRONT_PACKAGES), yes)
make clear-front
endif

## Enable development mode and disable caching
dev:
Expand Down
25 changes: 9 additions & 16 deletions scripts/makefile/front.mk
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Evaluate recursively.
CUID ?= $(LOCAL_UID)
CGID ?= $(LOCAL_GID)
CLEAR_FRONT_PACKAGES?=yes
FRONT_PORT?=65200

# Execute front container function.
front = docker run \
frontexec = docker run \
--rm \
--init \
-p $(FRONT_PORT):$(FRONT_PORT) \
Expand All @@ -15,26 +11,23 @@ front = docker run \
$(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
@echo "Clean of node_modules and compiled dist... To skip this action please set CLEAR_FRONT_PACKAGES=no in .env file"
$(call frontexec, rm -rf /app/node_modules /app/dist)

front:
@echo "Running front tasks..."
docker pull $(IMAGE_FRONT)
$(call front, yarn install --prod --ignore-optional --check-files)
$(call front, yarn build --verbose)
make clear-front
$(call frontexec, yarn install --prod --ignore-optional --check-files)
$(call frontexec, yarn build --verbose)

lint:
@echo "Running theme linters with fix..."
docker pull $(IMAGE_FRONT)
$(call front, yarn install --prod --ignore-optional --check-files)
$(call front, yarn lint-fix)
$(call frontexec, yarn install --prod --ignore-optional --check-files)
$(call frontexec, 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))
$(call frontexec, yarn install --ignore-optional --check-files)
$(call frontexec, yarn storybook -p $(FRONT_PORT))

0 comments on commit 7e1de54

Please sign in to comment.