-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (28 loc) · 1.17 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
PROJECT_NAME=items
all: test
clean:
cd backend && cargo clean
backend-lint:
cd backend && cargo clippy
build:
cd backend && cargo check --verbose
cd backend && cargo b --verbose
test: build
cd backend && cargo t
docker_login:
docker login ghcr.io -u $(GITHUB_USER) -p $(GITHUB_TOKEN)
backend_container:
cd backend && docker build -t ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_backend:latest .
frontend_container:
cd frontend && docker build -t ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_frontend:latest .
containers: test backend_container frontend_container
publish_containers: docker_login containers
docker push ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_backend:latest
docker push ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_frontend:latest
backend_container_tagged: docker_login
cd backend && docker build -t ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_backend:$(DOCKERTAG) .
frontend_container_tagged: docker_login
cd frontend && docker build -t ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_frontend:$(DOCKERTAG) .
publish_containers_tagged: containers
docker push ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_backend:$(DOCKERTAG)
docker push ghcr.io/$(GITHUB_USER)/$(PROJECT_NAME)_frontend:$(DOCKERTAG)