| |
@@ -1,31 +1,56 @@ |
| 1 |
1 |
.PHONY: serve build docker-static docker-run test clean docker-up docker-down generate-keys migrate |
| 2 |
2 |
|
|
3 |
+LATEST_TAG := $(shell git tag --sort=-version:refname | head -n 1) |
|
4 |
+ |
| 3 |
5 |
serve: |
| 4 |
6 |
go run . serve |
| 5 |
7 |
|
| 6 |
8 |
generate: |
| 7 |
9 |
go run . generate |
| 8 |
10 |
|
| 9 |
11 |
build: |
| 10 |
12 |
GOOS=linux GOARCH=arm64 go build -o quilldrop |
| 11 |
13 |
|
| 12 |
14 |
docker-static: |
| 13 |
15 |
podman build --platform linux/arm64 -t quilldrop -f ./Dockerfile-static . |
| 14 |
16 |
|
| 15 |
17 |
docker-images: |
| 16 |
|
- $(eval LATEST_TAG := $(shell git tag --sort=-version:refname | head -n 1)) |
| 17 |
|
- podman build --platform linux/amd64,linux/arm64 \ |
| 18 |
|
- --manifest ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images \ |
|
18 |
+ @echo "Building for tag: $(LATEST_TAG)" |
|
19 |
+ @echo "Building AMD64..." |
|
20 |
+ podman build --platform linux/amd64 \ |
|
21 |
+ -t ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images-amd64 \ |
|
22 |
+ -f ./Dockerfile-images . |
|
23 |
+ @echo "Building ARM64..." |
|
24 |
+ podman build --platform linux/arm64 \ |
|
25 |
+ -t ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images-arm64 \ |
| 19 |
26 |
-f ./Dockerfile-images . |
|
27 |
+ @echo "Creating manifest..." |
|
28 |
+ podman manifest rm ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images 2>/dev/null || true |
|
29 |
+ podman manifest create ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images |
|
30 |
+ @echo "Adding AMD64 to manifest..." |
|
31 |
+ podman manifest add ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images \ |
|
32 |
+ ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images-amd64 |
|
33 |
+ @echo "Adding ARM64 to manifest..." |
|
34 |
+ podman manifest add ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images \ |
|
35 |
+ ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images-arm64 |
|
36 |
+ @echo "Inspecting manifest:" |
|
37 |
+ podman manifest inspect ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images |
|
38 |
+ @echo "Pushing manifest:" |
| 20 |
39 |
podman manifest push --all ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images |
| 21 |
|
- |
|
40 |
+# docker-images: |
|
41 |
+# $(eval LATEST_TAG := $(shell git tag --sort=-version:refname | head -n 1)) |
|
42 |
+# podman build --platform linux/amd64,linux/arm64 \ |
|
43 |
+# --manifest ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images \ |
|
44 |
+# -f ./Dockerfile-images . |
|
45 |
+# podman manifest push --all ghcr.io/9it-full-service/quilldrop:$(LATEST_TAG)-images |
|
46 |
+ |
| 22 |
47 |
docker-run: |
| 23 |
48 |
podman run --rm -i -p 8081:80 quilldrop:latest |
| 24 |
49 |
|
| 25 |
50 |
test: |
| 26 |
51 |
go test ./... |
| 27 |
52 |
|
| 28 |
53 |
clean: |
| 29 |
54 |
rm -rf bin/ |
| 30 |
55 |
|
| 31 |
56 |
docker-up: |