| gio | 4eb2efe | 2024-07-12 20:55:31 +0400 | [diff] [blame] | 1 | repo_name ?= dtabidze |
| 2 | podman ?= docker |
| 3 | ifeq ($(podman), podman) |
| 4 | manifest_dest=docker://docker.io/$(repo_name)/rpuppy:latest |
| 5 | endif |
| 6 | |
| giolekva | d972536 | 2021-07-14 21:03:11 +0400 | [diff] [blame] | 7 | clean: |
| 8 | rm -f rpuppy |
| 9 | |
| Giorgi Lekveishvili | fe432b8 | 2023-11-07 15:23:30 +0400 | [diff] [blame] | 10 | build_arm64: export CGO_ENABLED=0 |
| 11 | build_arm64: export GO111MODULE=on |
| 12 | build_arm64: export GOOS=linux |
| 13 | build_arm64: export GOARCH=arm64 |
| 14 | build_arm64: |
| 15 | go build -o rpuppy_arm64 *.go |
| giolekva | d972536 | 2021-07-14 21:03:11 +0400 | [diff] [blame] | 16 | |
| Giorgi Lekveishvili | fe432b8 | 2023-11-07 15:23:30 +0400 | [diff] [blame] | 17 | build_amd64: export CGO_ENABLED=0 |
| 18 | build_amd64: export GO111MODULE=on |
| 19 | build_amd64: export GOOS=linux |
| 20 | build_amd64: export GOARCH=amd64 |
| 21 | build_amd64: |
| 22 | go build -o rpuppy_amd64 *.go |
| giolekva | d972536 | 2021-07-14 21:03:11 +0400 | [diff] [blame] | 23 | |
| Giorgi Lekveishvili | fe432b8 | 2023-11-07 15:23:30 +0400 | [diff] [blame] | 24 | push_arm64: clean build_arm64 |
| gio | 4eb2efe | 2024-07-12 20:55:31 +0400 | [diff] [blame] | 25 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/rpuppy:arm64 . |
| 26 | $(podman) push $(repo_name)/rpuppy:arm64 |
| giolekva | d972536 | 2021-07-14 21:03:11 +0400 | [diff] [blame] | 27 | |
| Giorgi Lekveishvili | fe432b8 | 2023-11-07 15:23:30 +0400 | [diff] [blame] | 28 | push_amd64: clean build_amd64 |
| gio | 4eb2efe | 2024-07-12 20:55:31 +0400 | [diff] [blame] | 29 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/rpuppy:amd64 . |
| 30 | $(podman) push $(repo_name)/rpuppy:amd64 |
| Giorgi Lekveishvili | fe432b8 | 2023-11-07 15:23:30 +0400 | [diff] [blame] | 31 | |
| 32 | push: push_arm64 push_amd64 |
| gio | 4eb2efe | 2024-07-12 20:55:31 +0400 | [diff] [blame] | 33 | $(podman) manifest create $(repo_name)/rpuppy:latest $(repo_name)/rpuppy:arm64 $(repo_name)/rpuppy:amd64 |
| 34 | $(podman) manifest push $(repo_name)/rpuppy:latest $(manifest_dest) |
| 35 | $(podman) manifest rm $(repo_name)/rpuppy:latest |