-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
64 lines (44 loc) · 1.87 KB
/
makefile
File metadata and controls
64 lines (44 loc) · 1.87 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
59
60
61
62
63
64
include .env
all: build
build: generate test
if [ ! -d "build" ]; then mkdir build; fi
echo "Building main.go"
go build -o build/main ./cmd/main.go
build-gql: test
if [ ! -d "build" ]; then mkdir build; fi
echo "Building main.go"
go build -o build/gql-main ./gateway/main.go
run: fetch-data build
echo "Now running main"
./build/main
run-gql: build-gql
echo "Running GraphQL Server"
./build/gql-main
test: fetch-data
go test ./...
test-k8s:
GRPC_HOST=10.0.0.108:30003 go test ./... --ginkgo.label-filter "integration"
fetch-data:
if [ ! -d "data" ]; then mkdir data; fi
echo "Checking for missing scryfall-db"
if [ ! -f "data/scryfall-db.json" ]; then curl -o data/scryfall-db.json https://data.scryfall.io/oracle-cards/oracle-cards-20241217220246.json; fi
clean:
rm -r ./build
generate:
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative --graphql_out=.. "api/manabase-simulation.proto"
deploy: docker-build docker-push k8s-rollout-all-updates
docker-build: docker-build-server docker-build-gateway
docker-push: docker-push-server docker-push-gateway
docker-build-server:
docker build --platform=linux/amd64 -t 100.69.236.43:32000/manabase-simulation-server:latest -f Dockerfile .
docker-push-server:
docker push 100.69.236.43:32000/manabase-simulation-server:latest
docker-build-gateway:
docker build --platform=linux/amd64 -t 100.69.236.43:32000/manabase-simulation-gql-gateway:latest -f gateway/Dockerfile .
docker-push-gateway:
docker push 100.69.236.43:32000/manabase-simulation-gql-gateway:latest
k8s-rollout-all-updates: k8s-rollout-server-updates k8s-rollout-gql-updates
k8s-rollout-server-updates:
kubectl rollout restart deployment -n mtg-mana-sim-app manabase-simulation-server-deployment
k8s-rollout-gql-updates:
kubectl rollout restart deployment -n mtg-mana-sim-app manabase-simulation-gql-deployment