-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/4.0.4' into v4
- Loading branch information
Showing
79 changed files
with
8,205 additions
and
9,432 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
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,28 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
# Misc directories & files | ||
coverage/* | ||
.stylelintcache |
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,43 +1,38 @@ | ||
TAG?=16-alpine | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-buildchain | ||
DOCKERRUN=docker container run \ | ||
--name ${CONTAINER} \ | ||
--rm \ | ||
-t \ | ||
--network plugindev_default \ | ||
-p 3001:3001 \ | ||
-v "${CURDIR}"/../:/app \ | ||
${CONTAINER}:${TAG} | ||
MAJOR_VERSION?=4 | ||
TAG?=18-alpine | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-buildchain | ||
DEV_PORT?=300${MAJOR_VERSION} | ||
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) | ||
IMAGE_NAME=${CONTAINER}:${TAG} | ||
DOCKER_RUN=docker container run --rm -it --network plugindev_default -v "${CURDIR}"/../:/app | ||
|
||
.PHONY: build dev docker install clean npm | ||
.PHONY: build clean dev image-build image-check npm ssh | ||
|
||
# Build the production assets | ||
build: docker install | ||
${DOCKERRUN} \ | ||
run build | ||
# Start up the dev server | ||
dev: docker install | ||
${DOCKERRUN} \ | ||
run dev | ||
# Start the Docker container | ||
docker: | ||
docker build \ | ||
. \ | ||
-t ${CONTAINER}:${TAG} \ | ||
--build-arg TAG=${TAG} \ | ||
--no-cache | ||
# Run an npm install | ||
install: docker | ||
${DOCKERRUN} \ | ||
install | ||
# Remove node_modules/* & package-lock.json | ||
# Perform a dist build via npm run build | ||
build: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run build | ||
# Remove node_modules/ & package-lock.json | ||
clean: | ||
rm -rf node_modules/ | ||
rm -f package-lock.json | ||
# Run the development server via npm run dev | ||
dev: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DEV_PORT="${DEV_PORT}" -p ${DEV_PORT}:${DEV_PORT} ${IMAGE_NAME} run dev | ||
# Build the Docker image & run npm install | ||
image-build: | ||
docker build . -t ${IMAGE_NAME} --build-arg TAG=${TAG} --no-cache | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} install | ||
# Ensure the image has been created | ||
image-check: | ||
ifeq ($(IMAGE_INFO), []) | ||
image-check: image-build | ||
endif | ||
# Run the passed in npm command | ||
npm: docker | ||
${DOCKERRUN} \ | ||
$(filter-out $@,$(MAKECMDGOALS)) | ||
npm: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} $(filter-out $@,$(MAKECMDGOALS)) $(MAKEFLAGS) | ||
# Open a shell inside of the container | ||
ssh: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ --entrypoint=/bin/sh ${IMAGE_NAME} | ||
%: | ||
@: | ||
# ref: https://stackoverflow.com/questions/6273608/how-to-pass-argument-to-makefile-from-command-line |
Oops, something went wrong.