-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
71 lines (57 loc) · 2.63 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
COMPOSE_TOOLING_RUN = docker compose -f compose.tooling.yaml run --rm --build tooling
COMPOSE_E2E = docker compose -f compose.yaml -f compose.override.e2e.yaml
COMPOSE_E2E_RUN = $(COMPOSE_E2E) run --rm --build e2e-test-runner
COMPOSE_APP_DEV = docker compose -f compose.yaml -f compose.override.yaml
COMPOSE_RUN_DOCS = docker compose -f compose.yaml -f compose.override.yaml run docs
COMPOSE_PUBLISH = docker compose -f compose.yaml -f compose.override.publish.yaml
help: ## Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
bash: ## Opens bash shell in tooling container
$(COMPOSE_TOOLING_RUN) bash
test: ## Runs test suite
$(COMPOSE_TOOLING_RUN) dotnet test
test-e2e: ## Runs E2E test suite
$(COMPOSE_E2E_RUN)
$(COMPOSE_E2E) down
build-dev: ## Builds development docker images
$(COMPOSE_APP_DEV) build
start-dev: build-dev ## Starts development environment
$(COMPOSE_APP_DEV) up -d
clean-dev: ## Cleans development environment
$(COMPOSE_APP_DEV) down --remove-orphans
reset-dev: ## Resets development environment
$(COMPOSE_APP_DEV) down --remove-orphans --volumes
update-api-reference: ## Updates OpenAPI schemas in docs site
$(COMPOSE_TOOLING_RUN) scripts/update-api-reference.sh
check-api-reference: ## Checks OpenAPI schemas are updated
$(COMPOSE_TOOLING_RUN) scripts/check-api-reference.sh
build-docs: ## Builds documentation site
$(COMPOSE_RUN_DOCS) build --strict --clean
check-formatting: ## Checks code formatting
$(COMPOSE_TOOLING_RUN) dotnet tool run dotnet-csharpier . --check
fix-formatting: ## Fix code formatting
$(COMPOSE_TOOLING_RUN) dotnet tool run dotnet-csharpier .
# TODO: move gh into tooling container (requires env var considerations)
VERSION =
release: ## Pushes docker images to ghcr.io and create a github release
ifndef VERSION
$(error VERSION is undefined)
endif
ifndef GITHUB_PAT
$(error GITHUB_PAT env var is not set)
endif
ifndef GITHUB_USERNAME
$(error GITHUB_USERNAME env var is not set)
endif
ifneq "$(shell git branch --show-current)" "master"
$(error This command can only be run on the master branch)
endif
ifneq "$(shell git diff --name-only master)" ""
$(error There are uncommitted changes in the working directory)
endif
echo $$GITHUB_PAT | docker login ghcr.io --username $$GITHUB_USERNAME --password-stdin
VERSION=$(VERSION) $(COMPOSE_PUBLISH) build
VERSION=$(VERSION) $(COMPOSE_PUBLISH) push difficalcy-osu difficalcy-taiko difficalcy-catch difficalcy-mania
VERSION=latest $(COMPOSE_PUBLISH) build
VERSION=latest $(COMPOSE_PUBLISH) push difficalcy-osu difficalcy-taiko difficalcy-catch difficalcy-mania
gh release create "$(VERSION)" --generate-notes