| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 1 | repo_name ?= giolekva |
| 2 | podman ?= docker |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame^] | 3 | docker_flags=--provenance=false --sbom=false |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 4 | ifeq ($(podman), podman) |
| gio | 5588514 | 2024-08-16 13:11:00 +0400 | [diff] [blame] | 5 | manifest_dest=docker://docker.io/$(repo_name)/auth-proxy:latest |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 6 | endif |
| 7 | |
| 8 | clean: |
| 9 | rm -f server server_* |
| 10 | |
| 11 | build: clean |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame] | 12 | /usr/local/go/bin/go build -o server *.go |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 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: |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame] | 19 | /usr/local/go/bin/go build -o server_arm64 *.go |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 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: |
| Giorgi Lekveishvili | a09fad7 | 2024-03-21 15:24:35 +0400 | [diff] [blame] | 26 | /usr/local/go/bin/go build -o server_amd64 *.go |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 27 | |
| 28 | push_arm64: clean build_arm64 |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame^] | 29 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/auth-proxy:arm64 $(docker_flags) . |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 30 | $(podman) push $(repo_name)/auth-proxy:arm64 |
| 31 | |
| 32 | push_amd64: clean build_amd64 |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame^] | 33 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/auth-proxy:amd64 $(docker_flags) . |
| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 34 | $(podman) push $(repo_name)/auth-proxy:amd64 |
| 35 | |
| 36 | |
| 37 | push: push_arm64 push_amd64 |
| 38 | $(podman) manifest create $(repo_name)/auth-proxy:latest $(repo_name)/auth-proxy:arm64 $(repo_name)/auth-proxy:amd64 |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame^] | 39 | $(podman) manifest push --purge $(repo_name)/auth-proxy:latest $(manifest_dest) |