-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (54 loc) · 2.03 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
72
73
REPO = pixelaw/core
CORE_VERSION = 0.0.71
KEIKO_VERSION = v0.0.15
docker_build:
docker build -t $(REPO):$(CORE_VERSION) -t $(REPO):latest --build-arg KEIKO_VERSION=$(KEIKO_VERSION) --progress=plain .
docker_run:
docker run -p 3000:3000 -p 5050:5050 -p 8080:8080 $(REPO):$(CORE_VERSION)
build:
cd contracts;sozo build;
# cp contracts/target/dev/manifest.json web/src/dojo/manifest.json;
# node web/src/generateComponents.cjs;
# cp web/src/output.ts web/src/dojo/contractComponents.ts
shell:
docker run -it --rm --name temp-container pixelaw/core:latest bash
test:
cd contracts; sozo test
prep_web:
cd web; cp .env.example .env
start_keiko: stop_keiko
make build
docker compose up -d
restart_keiko: build
docker compose down -v && docker compose up -d && docker compose logs -f
stop_keiko:
docker compose down
redeploy:
@cd contracts; \
WORLD_ADDR=$$(tail -n1 ../last_deployed_world); \
sozo migrate --world $$WORLD_ADDR;
deploy:
@cd contracts; \
SOZO_OUT="$$(sozo migrate)"; echo "$$SOZO_OUT"; \
WORLD_ADDR="$$(echo "$$SOZO_OUT" | grep "Successfully migrated World at address" | rev | cut -d " " -f 1 | rev)"; \
[ -n "$$WORLD_ADDR" ] && \
echo "$$WORLD_ADDR" > ../last_deployed_world && \
echo "$$SOZO_OUT" > ../deployed.log; \
WORLD_ADDR=$$(tail -n1 ../last_deployed_world); \
# Update version
# Get the latest tag
VERSION=$(shell git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//')
# Define the version type (major, minor, patch)
type ?= patch
# Increment the version based on the version type
NEW_VERSION=$(shell echo $(VERSION) | awk -F. -v type=$(type) 'BEGIN {OFS = FS} \
{if (type == "major") {$$1=$$1+1; $$2=0; $$3=0} else if (type == "minor") {$$2=$$2+1; $$3=0} else if (type == "patch") $$3=$$3+1} \
{print $$1"."$$2"."$$3}')
# To use tag make push-tag
# type=patch for patch version, type=minor for minor version, type=major for major version
push-tag:
echo v$(VERSION) to $(CORE_VERSION)
# Create a new tag
git tag $(CORE_VERSION)
# Push the tag to the remote repository
git push origin $(CORE_VERSION)