| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 1 | repo_name ?= dtabidze |
| 2 | podman ?= docker |
| 3 | |
| giolekva | 603e73a | 2021-10-22 14:46:45 +0400 | [diff] [blame] | 4 | clean: |
| Giorgi Lekveishvili | 58cb148 | 2023-12-04 12:33:49 +0400 | [diff] [blame] | 5 | rm -f server server_* |
| 6 | |
| 7 | build: clean |
| 8 | go build -o server *.go |
| giolekva | 603e73a | 2021-10-22 14:46:45 +0400 | [diff] [blame] | 9 | |
| giolekva | 6f3e233 | 2021-12-04 19:42:13 +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 server_arm64 *.go |
| giolekva | 603e73a | 2021-10-22 14:46:45 +0400 | [diff] [blame] | 16 | |
| giolekva | 6f3e233 | 2021-12-04 19:42:13 +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 server_amd64 *.go |
| giolekva | 603e73a | 2021-10-22 14:46:45 +0400 | [diff] [blame] | 23 | |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 24 | push_arm64: clean build_arm64 |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 25 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/auth-ui:arm64 . |
| 26 | $(podman) push $(repo_name)/auth-ui:arm64 |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 27 | |
| 28 | push_amd64: clean build_amd64 |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 29 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/auth-ui:amd64 . |
| 30 | $(podman) push $(repo_name)/auth-ui:amd64 |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 31 | |
| 32 | |
| 33 | push: push_arm64 push_amd64 |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 34 | $(podman) manifest create $(repo_name)/auth-ui:latest $(repo_name)/auth-ui:arm64 $(repo_name)/auth-ui:amd64 |
| 35 | $(podman) manifest push $(repo_name)/auth-ui:latest |
| 36 | $(podman) manifest rm $(repo_name)/auth-ui:latest |