-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
47 lines (35 loc) · 1.1 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
.DEFAULT_GOAL := run
run:
go run .
run-build:
make build
./bin/crb
run-docker:
docker run -v $$(pwd)/.env:/app/.env:ro -it --rm ghcr.io/nathan13888/coderunnerbot/crb:latest
build:
go build -o bin/crb -ldflags "\
-X 'main.BuildVersion=$$(git rev-parse --abbrev-ref HEAD)' \
-X 'main.BuildTime=$$(date)' \
-X 'main.GOOS=$$(go env GOOS)' \
-X 'main.ARCH=$$(go env GOARCH)' \
-s -w"
docker-build:
docker build -t crb .
build-piston:
docker build -t crb-piston piston/api
docker build -t crb-piston-repo piston/repo
docker tag crb-piston:latest ghcr.io/nathan13888/coderunnerbot/piston:latest
docker tag crb-piston-repo:latest ghcr.io/nathan13888/coderunnerbot/piston-repo:latest
publish-piston:
docker push ghcr.io/nathan13888/coderunnerbot/piston:latest
docker push ghcr.io/nathan13888/coderunnerbot/piston-repo:latest
publish:
make publish-ghcr
publish-ghcr:
#make docker-build
docker tag crb:latest ghcr.io/nathan13888/coderunnerbot/crb:latest
docker push ghcr.io/nathan13888/coderunnerbot/crb:latest
pull-ghcr:
docker pull ghcr.io/nathan13888/coderunnerbot/crb:latest
test:
go test -v ./...