repos / git-pr

a self-hosted git collaboration server
git clone https://github.com/picosh/git-pr.git

jolheiser  ·  2025-04-05

Makefile

 1DOCKER_TAG?=$(shell git log --format="%H" -n 1)
 2DOCKER_PLATFORM?=linux/amd64,linux/arm64
 3DOCKER_CMD?=docker
 4DOCKER_BUILDX_BUILD?=$(DOCKER_CMD) buildx build --push --platform $(DOCKER_PLATFORM)
 5
 6fmt:
 7	go fmt ./...
 8	deno fmt README.md
 9.PHONY: fmt
10
11lint:
12	golangci-lint run -E goimports -E godot --timeout 10m
13.PHONY: lint
14
15test:
16	go test ./...
17.PHONY: test
18
19snapshot:
20	UPDATE_SNAPS=true go test ./...
21.PHONY: snapshot
22
23build:
24	go build -o ./build/git-ssh ./cmd/git-ssh
25	go build -o ./build/git-web ./cmd/git-web
26.PHONY: build
27
28bp-setup:
29	$(DOCKER_CMD) buildx ls | grep pico || $(DOCKER_CMD) buildx create --name pico
30	$(DOCKER_CMD) buildx use pico
31.PHONY: bp-setup
32
33bp-web: bp-setup
34	$(DOCKER_BUILDX_BUILD) -t "ghcr.io/picosh/pico/git-web:$(DOCKER_TAG)" --target release-web .
35.PHONY: bp-web
36
37bp: bp-web
38	$(DOCKER_BUILDX_BUILD) -t "ghcr.io/picosh/pico/git-ssh:$(DOCKER_TAG)" --target release-ssh .
39.PHONY: bp
40
41deploy: bp-web
42	ssh ppipe pub git-pr-deploy -e
43.PHONY: deploy
44
45smol:
46	curl https://pico.sh/smol.css -o ./static/smol.css
47.PHONY: smol