-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
47 lines (37 loc) · 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
47
DOCKER_TAG?=$(shell git log --format="%H" -n 1)
DOCKER_PLATFORM?=linux/amd64,linux/arm64
DOCKER_CMD?=docker
DOCKER_BUILDX_BUILD?=$(DOCKER_CMD) buildx build --push --platform $(DOCKER_PLATFORM)
fmt:
go fmt ./...
deno fmt README.md
.PHONY: fmt
lint:
golangci-lint run -E goimports -E godot --timeout 10m
.PHONY: lint
test:
go test ./...
.PHONY: test
snapshot:
UPDATE_SNAPS=true go test ./...
.PHONY: snapshot
build:
go build -o ./build/ssh ./cmd/ssh
go build -o ./build/web ./cmd/web
.PHONY: build
bp-setup:
$(DOCKER_CMD) buildx ls | grep pico || $(DOCKER_CMD) buildx create --name pico
$(DOCKER_CMD) buildx use pico
.PHONY: bp-setup
bp-web: bp-setup
$(DOCKER_BUILDX_BUILD) -t "ghcr.io/picosh/pico/git-web:$(DOCKER_TAG)" --target release-web .
.PHONY: bp-web
bp: bp-web
$(DOCKER_BUILDX_BUILD) -t "ghcr.io/picosh/pico/git-ssh:$(DOCKER_TAG)" --target release-ssh .
.PHONY: bp
deploy: bp-web
ssh ppipe pub git-pr-deploy -e
.PHONY: deploy
smol:
curl https://pico.sh/smol.css -o ./static/smol.css
.PHONY: smol