-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (48 loc) · 1.51 KB
/
Makefile
File metadata and controls
58 lines (48 loc) · 1.51 KB
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
.DEFAULT_GOAL := list
UID := $(shell id -u)
GID := $(shell id -g)
# List all commands in this file.
.PHONY: list
list:
@grep '^[^#[:space:]].*:' Makefile
# Set up the development environment.
.PHONY: setup
setup:
# Build the sandbox.
docker compose -f docker-compose.dev.yml build \
--build-arg uid=${UID} \
--build-arg gid=${GID}
# Install tools and dependencies.
docker compose -f docker-compose.dev.yml run --rm sandbox \
go mod download
docker compose -f docker-compose.dev.yml run --rm sandbox \
go install tool
docker compose -f docker-compose.dev.yml run --rm sandbox \
npm ci
# Start the development environment.
.PHONY: dev
dev:
docker compose -f docker-compose.dev.yml up -d
# Build the CSS once.
docker compose -f docker-compose.dev.yml exec sandbox \
npx @tailwindcss/cli -i tailwind.css -o app.css
# Start the application and automatic rebuild.
docker compose -f docker-compose.dev.yml exec sandbox \
npx concurrently -n tailwind,go -c blue,green --kill-others-on-fail \
"npx @tailwindcss/cli -i tailwind.css -o app.css --watch" \
"air -c .air.toml"
# Stop the development environment.
.PHONY: stop
stop:
docker compose -f docker-compose.dev.yml down
# Lint application code.
.PHONY: lint
lint:
docker compose -f docker-compose.dev.yml run --rm sandbox \
npx concurrently --raw=true --group \
"revive -formatter=stylish -exclude=./vendor/... -config=revive.toml ./..." \
"eslint"
# Build the production docker image.
.PHONY: build
build:
docker build -t ghcr.io/mgnsk/calendar:edge .