-
-
Notifications
You must be signed in to change notification settings - Fork 15
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.5' into v4
- Loading branch information
Showing
14 changed files
with
1,473 additions
and
1,280 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
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,3 +1,4 @@ | ||
/vendor | ||
/node_modules | ||
docs/.vitepress/dist | ||
/docs/.vitepress/dist | ||
/docs/.vitepress/cache |
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,5 +1,7 @@ | ||
ARG TAG=14-alpine | ||
FROM nystudio107/node-dev-base:$TAG | ||
FROM node:$TAG | ||
|
||
USER node | ||
|
||
WORKDIR /app/ | ||
|
||
|
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,53 +1,47 @@ | ||
MAJOR_VERSION?=4 | ||
TAG?=14-alpine | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-docs | ||
DOCKERRUN=docker container run \ | ||
--name ${CONTAINER} \ | ||
--rm \ | ||
-p 3002:3002 \ | ||
-t \ | ||
-v `pwd`:/app \ | ||
${CONTAINER}:${TAG} | ||
DOCSDEST?=../../../sites/nystudio107/web/docs/recipe | ||
CONTAINER?=$(shell basename $(dir $(CURDIR)))-v${MAJOR_VERSION}-docs | ||
DOCS_DEV_PORT?=400${MAJOR_VERSION} | ||
DOCS_DEST?=../../../sites/nystudio107/web/docs/recipe | ||
IMAGE_INFO=$(shell docker image inspect $(CONTAINER):$(TAG)) | ||
IMAGE_NAME=${CONTAINER}:${TAG} | ||
DOCKER_RUN=docker container run --rm -it -v "${CURDIR}":/app | ||
|
||
.PHONY: docker build dev fix install lint clean npm | ||
.PHONY: build clean dev fix image-build image-check lint npm ssh | ||
|
||
# Start the Docker container | ||
docker: | ||
docker build \ | ||
. \ | ||
-t ${CONTAINER}:${TAG} \ | ||
--build-arg TAG=${TAG} \ | ||
--no-cache | ||
# Build the production docs | ||
build: docker install | ||
${DOCKERRUN} \ | ||
run docs:build | ||
rm -rf ${DOCSDEST} | ||
mv ./docs/.vitepress/dist ${DOCSDEST} | ||
# Start up the dev server | ||
dev: docker install | ||
${DOCKERRUN} \ | ||
run docs:dev | ||
# Fix the docs via textlint | ||
fix: docker install | ||
${DOCKERRUN} \ | ||
run docs:fix | ||
# Run an npm install | ||
install: docker | ||
${DOCKERRUN} \ | ||
install | ||
# Lint the docs via textlint | ||
lint: docker install | ||
${DOCKERRUN} \ | ||
run docs:lint | ||
# Remove node_modules/* & package-lock.json | ||
# Perform a dist build via npm run docs:build | ||
build: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:build | ||
rm -rf ${DOCS_DEST} | ||
mv ./docs/.vitepress/dist ${DOCS_DEST} | ||
# Remove node_modules/ & package-lock.json | ||
clean: | ||
rm -rf node_modules/ | ||
rm -f package-lock.json | ||
# Run the development server via npm run docs:dev | ||
dev: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ -e DOCS_DEV_PORT="${DOCS_DEV_PORT}" -p ${DOCS_DEV_PORT}:${DOCS_DEV_PORT} ${IMAGE_NAME} run docs:dev | ||
# Fix the docs with textlint via npm run docs:fix | ||
fix: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:fix | ||
# 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 | ||
# Lint the docs with textlint via npm run docs:lint | ||
lint: image-check | ||
${DOCKER_RUN} --name ${CONTAINER}-$@ ${IMAGE_NAME} run docs:lint | ||
# 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 |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.