-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (47 loc) · 1.55 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
export CGO_ENABLED:=0
VERSION=$(shell git describe --tags --match=v* --always)
LD_FLAGS="-w -X github.com/poseidon/github-runner/cmd.version=$(VERSION)"
REPO=github.com/poseidon/github-runner
LOCAL_REPO=poseidon/github-runner
IMAGE_REPO=quay.io/poseidon/github-runner
.PHONY: all
all: bin test vet fmt
.PHONY: bin
bin:
@go build -o bin/gha -ldflags $(LD_FLAGS) $(REPO)/cmd/gha
.PHONY: test
test:
@go test ./... -cover
.PHONY: vet
vet:
@go vet -all ./...
.PHONY: fmt
fmt:
@test -z $$(go fmt ./...)
image: \
image-amd64 \
image-arm64
image-%:
buildah bud -f Dockerfile.$* \
--security-opt seccomp=unconfined \
-t $(LOCAL_REPO):$(VERSION)-$* \
--layers \
--arch $* --override-arch $* \
.
push-%:
buildah tag $(LOCAL_REPO):$(VERSION)-$* $(IMAGE_REPO):$(VERSION)-$*
buildah push --format v2s2 $(IMAGE_REPO):$(VERSION)-$*
manifest:
buildah manifest create $(IMAGE_REPO):$(VERSION)
buildah manifest add $(IMAGE_REPO):$(VERSION) docker://$(IMAGE_REPO):$(VERSION)-amd64
buildah manifest add --variant v8 $(IMAGE_REPO):$(VERSION) docker://$(IMAGE_REPO):$(VERSION)-arm64
buildah manifest inspect $(IMAGE_REPO):$(VERSION)
buildah manifest push -f v2s2 $(IMAGE_REPO):$(VERSION) docker://$(IMAGE_REPO):$(VERSION)
.PHONY: run
run:
podman run \
-it \
--env-file ~/.config/github-runner/poseidon.env \
-v $(shell readlink -f ~/.config/github-runner/poseidon.env):/etc/github-runner/dghubble-org.env \
-v $(shell readlink -f ~/.config/github-runner/github-app.key.pem):/etc/github-runner/github-app.key.pem \
localhost/poseidon/github-runner:$(VERSION)-amd64