| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame^] | 1 | repo_name ?= giolekva |
| 2 | podman ?= docker |
| 3 | ifeq ($(podman), podman) |
| 4 | manifest_dest=docker://docker.io/$(repo_name)/headscale-api:latest |
| 5 | endif |
| 6 | |
| Giorgi Lekveishvili | 52814d9 | 2023-06-15 19:30:32 +0400 | [diff] [blame] | 7 | clean: |
| 8 | rm -f server_* |
| 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 server_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 server_amd64 *.go |
| 23 | |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 24 | push_arm64: clean build_arm64 |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame^] | 25 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/headscale-api:arm64 . |
| 26 | $(podman) push $(repo_name)/headscale-api:arm64 |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 27 | |
| 28 | push_amd64: clean build_amd64 |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame^] | 29 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/headscale-api:amd64 . |
| 30 | $(podman) push $(repo_name)/headscale-api:amd64 |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 31 | |
| 32 | |
| 33 | push: push_arm64 push_amd64 |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame^] | 34 | $(podman) manifest create $(repo_name)/headscale-api:latest $(repo_name)/headscale-api:arm64 $(repo_name)/headscale-api:amd64 |
| 35 | $(podman) manifest push $(repo_name)/headscale-api:latest $(manifest_dest) |
| 36 | $(podman) manifest rm $(repo_name)/headscale-api:latest |