mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 10:03:21 -04:00
Merge pull request #2503 from GSA/update-makefile
Update Makefile to handle pre-existing git hooks
This commit is contained in:
18
Makefile
18
Makefile
@@ -6,6 +6,7 @@ APP_VERSION_FILE = app/version.py
|
|||||||
|
|
||||||
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
|
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
|
||||||
GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "")
|
GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "")
|
||||||
|
GIT_HOOKS_PATH ?= $(shell git config --global core.hooksPath || echo "")
|
||||||
|
|
||||||
VIRTUALENV_ROOT := $(shell [ -z $$VIRTUAL_ENV ] && echo $$(pwd)/venv || echo $$VIRTUAL_ENV)
|
VIRTUALENV_ROOT := $(shell [ -z $$VIRTUAL_ENV ] && echo $$(pwd)/venv || echo $$VIRTUAL_ENV)
|
||||||
|
|
||||||
@@ -14,7 +15,8 @@ NVMSH := $(shell [ -f "$(HOME)/.nvm/nvm.sh" ] && echo "$(HOME)/.nvm/nvm.sh" || e
|
|||||||
## DEVELOPMENT
|
## DEVELOPMENT
|
||||||
|
|
||||||
.PHONY: bootstrap
|
.PHONY: bootstrap
|
||||||
bootstrap: generate-version-file ## Set up everything to run the app
|
bootstrap: ## Set up everything to run the app
|
||||||
|
make generate-version-file
|
||||||
poetry self add poetry-dotenv-plugin
|
poetry self add poetry-dotenv-plugin
|
||||||
poetry lock --no-update
|
poetry lock --no-update
|
||||||
poetry install --sync --no-root
|
poetry install --sync --no-root
|
||||||
@@ -24,6 +26,20 @@ bootstrap: generate-version-file ## Set up everything to run the app
|
|||||||
source $(NVMSH) && npm ci --no-audit
|
source $(NVMSH) && npm ci --no-audit
|
||||||
source $(NVMSH) && npm run build
|
source $(NVMSH) && npm run build
|
||||||
|
|
||||||
|
.PHONY: bootstrap-with-git-hooks
|
||||||
|
bootstrap-with-git-hooks: ## Sets everything up and accounts for pre-existing git hooks
|
||||||
|
make generate-version-file
|
||||||
|
poetry self add poetry-dotenv-plugin
|
||||||
|
poetry lock --no-update
|
||||||
|
poetry install --sync --no-root
|
||||||
|
poetry run playwright install --with-deps
|
||||||
|
git config --global --unset-all core.hooksPath
|
||||||
|
poetry run pre-commit install
|
||||||
|
git config --global core.hookspath "${GIT_HOOKS_PATH}"
|
||||||
|
source $(NVMSH) --no-use && nvm install && npm install
|
||||||
|
source $(NVMSH) && npm ci --no-audit
|
||||||
|
source $(NVMSH) && npm run build
|
||||||
|
|
||||||
.PHONY: watch-frontend
|
.PHONY: watch-frontend
|
||||||
watch-frontend: ## Build frontend and watch for changes
|
watch-frontend: ## Build frontend and watch for changes
|
||||||
source $(NVMSH) && npm run watch
|
source $(NVMSH) && npm run watch
|
||||||
|
|||||||
Reference in New Issue
Block a user