| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame^] | 1 | repo_name ?= dtabidze |
| 2 | podman ?= docker |
| 3 | ifeq ($(podman), podman) |
| 4 | manifest_dest=docker://docker.io/$(repo_name)/dns-challenge-solver:latest |
| 5 | endif |
| 6 | |
| Giorgi Lekveishvili | ae1a4a4 | 2023-12-07 13:23:17 +0400 | [diff] [blame] | 7 | clean: |
| 8 | rm -f dns-challenge-solver* |
| 9 | |
| 10 | # TODO(gio): fix go path |
| 11 | build: |
| 12 | /usr/local/go/bin/go build -o dns-challenge-solver *.go |
| 13 | |
| 14 | build_arm64: export CGO_ENABLED=0 |
| 15 | build_arm64: export GO111MODULE=on |
| 16 | build_arm64: export GOOS=linux |
| 17 | build_arm64: export GOARCH=arm64 |
| 18 | build_arm64: |
| 19 | /usr/local/go/bin/go build -o dns-challenge-solver_arm64 *.go |
| 20 | |
| 21 | build_amd64: export CGO_ENABLED=0 |
| 22 | build_amd64: export GO111MODULE=on |
| 23 | build_amd64: export GOOS=linux |
| 24 | build_amd64: export GOARCH=amd64 |
| 25 | build_amd64: |
| 26 | /usr/local/go/bin/go build -o dns-challenge-solver_amd64 *.go |
| 27 | |
| 28 | push_arm64: clean build_arm64 |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame^] | 29 | $(podman) build --platform linux/arm64 --tag=giolekva/dns-challenge-solver:arm64 . |
| 30 | $(podman) push giolekva/dns-challenge-solver:arm64 |
| Giorgi Lekveishvili | ae1a4a4 | 2023-12-07 13:23:17 +0400 | [diff] [blame] | 31 | |
| 32 | push_amd64: clean build_amd64 |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame^] | 33 | $(podman) build --platform linux/amd64 --tag=giolekva/dns-challenge-solver:amd64 . |
| 34 | $(podman) push giolekva/dns-challenge-solver:amd64 |
| Giorgi Lekveishvili | ae1a4a4 | 2023-12-07 13:23:17 +0400 | [diff] [blame] | 35 | |
| 36 | push: push_arm64 push_amd64 |
| gio | e72b54f | 2024-04-22 10:44:41 +0400 | [diff] [blame^] | 37 | $(podman) manifest create giolekva/dns-challenge-solver:latest giolekva/dns-challenge-solver:arm64 giolekva/dns-challenge-solver:amd64 |
| 38 | $(podman) manifest push giolekva/dns-challenge-solver:latest $(manifest_dest) |
| 39 | $(podman) manifest rm giolekva/dns-challenge-solver:latest |