-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 950 Bytes
/
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
pk_file := private.key
proof_file := proof.ucan
HEAD_SHORT ?= $(shell git rev-parse --short HEAD)
GOVVV=go run github.com/ahmetb/[email protected]
GOVVV_FLAGS=$(shell $(GOVVV) -flags -pkg $(shell go list ./buildinfo))
# local run
run:
@HTTP_PORT=8081 \
PRIVATEKEY=$(shell cat ${pk_file}) \
PROOF=$(shell cat ${proof_file} | xxd -p | tr -d '\n') \
SPACEID=did:key:z6MkfKyf5T9keTQqNpYpSPasLi7WSvzy1SmT5gvYZSPEVLpp \
go run .
.PHONY: run
# Lint
lint:
go run github.com/golangci/golangci-lint/cmd/[email protected] run
.PHONY: lint
# Build
build:
go build -ldflags="${GOVVV_FLAGS}" -o api .
.PHONY: build
# Test
test:
go test ./... -race
.PHONY: test
build-images:
docker build -t textile/basin_w3s:${HEAD_SHORT} .
docker tag textile/basin_w3s:${HEAD_SHORT} textile/basin_w3s:latest
.PHONY: build-images
push-images:
docker image push textile/basin_w3s:${HEAD_SHORT}
docker image push textile/basin_w3s:latest
.PHONY: push-images