| gio | 1afc3cd | 2024-10-04 19:28:15 +0400 | [diff] [blame] | 1 | repo_name ?= giolekva |
| 2 | podman ?= docker |
| 3 | ifeq ($(podman), podman) |
| 4 | manifest_dest=docker://docker.io/$(repo_name)/capture-config:latest |
| 5 | endif |
| 6 | |
| Giorgi Lekveishvili | 6d7dcb8 | 2023-12-20 14:44:42 +0400 | [diff] [blame] | 7 | clean: |
| 8 | rm -f capture-config_* |
| 9 | |
| 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 capture-config_arm64 *.go |
| 16 | |
| 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 capture-config_amd64 *.go |
| 23 | |
| 24 | push_arm64: clean build_arm64 |
| gio | 1afc3cd | 2024-10-04 19:28:15 +0400 | [diff] [blame] | 25 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/capture-config:arm64 . |
| 26 | $(podman) push $(repo_name)/capture-config:arm64 |
| Giorgi Lekveishvili | 6d7dcb8 | 2023-12-20 14:44:42 +0400 | [diff] [blame] | 27 | |
| 28 | push_amd64: clean build_amd64 |
| gio | 1afc3cd | 2024-10-04 19:28:15 +0400 | [diff] [blame] | 29 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/capture-config:amd64 . |
| 30 | $(podman) push $(repo_name)/capture-config:amd64 |
| Giorgi Lekveishvili | 6d7dcb8 | 2023-12-20 14:44:42 +0400 | [diff] [blame] | 31 | |
| 32 | push: push_arm64 push_amd64 |
| gio | 1afc3cd | 2024-10-04 19:28:15 +0400 | [diff] [blame] | 33 | $(podman) manifest create $(repo_name)/capture-config:latest $(repo_name)/capture-config:arm64 $(repo_name)/capture-config:amd64 |
| 34 | $(podman) manifest push $(repo_name)/capture-config:latest $(manifest_dest) |
| 35 | $(podman) manifest rm $(repo_name)/capture-config:latest |