Skip to content

Commit 3ad7a3b

Browse files
authored
Merge pull request #1648 from GSA/update-makefile
Update Makefile to handle pre-existing git hooks
2 parents aea7249 + bf38977 commit 3ad7a3b

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

Makefile

+15-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ DATE = $(shell date +%Y-%m-%d:%H:%M:%S)
55
APP_VERSION_FILE = app/version.py
66

77
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
8-
GIT_COMMIT ?= $(shell git rev-parse HEAD)
8+
GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "")
9+
GIT_HOOKS_PATH ?= $(shell git config --global core.hooksPath || echo "")
910

1011
## DEVELOPMENT
1112

@@ -23,6 +24,19 @@ bootstrap: ## Set up everything to run the app
2324
createdb test_notification_api || true
2425
(poetry run flask db upgrade) || true
2526

27+
.PHONY: bootstrap-with-git-hooks
28+
bootstrap-with-git-hooks: ## Sets everything up and accounts for pre-existing git hooks
29+
make generate-version-file
30+
poetry self add poetry-dotenv-plugin
31+
poetry lock --no-update
32+
poetry install --sync --no-root
33+
git config --global --unset-all core.hooksPath
34+
poetry run pre-commit install
35+
git config --global core.hookspath "${GIT_HOOKS_PATH}"
36+
createdb notification_api || true
37+
createdb test_notification_api || true
38+
(poetry run flask db upgrade) || true
39+
2640
.PHONY: bootstrap-with-docker
2741
bootstrap-with-docker: ## Build the image to run the app in Docker
2842
docker build -f docker/Dockerfile -t notifications-api .

0 commit comments

Comments
 (0)