@@ -5,7 +5,8 @@ DATE = $(shell date +%Y-%m-%d:%H:%M:%S)
5
5
APP_VERSION_FILE = app/version.py
6
6
7
7
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 "")
9
10
10
11
# # DEVELOPMENT
11
12
@@ -23,6 +24,19 @@ bootstrap: ## Set up everything to run the app
23
24
createdb test_notification_api || true
24
25
(poetry run flask db upgrade) || true
25
26
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
+
26
40
.PHONY : bootstrap-with-docker
27
41
bootstrap-with-docker : # # Build the image to run the app in Docker
28
42
docker build -f docker/Dockerfile -t notifications-api .
0 commit comments