| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 1 | repo_name ?= giolekva |
| 2 | podman ?= docker |
| 3 | ifeq ($($(podman)), $(podman)) |
| 4 | manifest_dest=docker://docker.io/$(repo_name)/fluxcd-reconciler:latest |
| 5 | endif |
| 6 | |
| Giorgi Lekveishvili | 2df23db | 2023-12-14 07:55:22 +0400 | [diff] [blame] | 7 | clean: |
| 8 | rm -rf tmp |
| 9 | rm -f fluxcd_reconciler fluxcd_reconciler_* |
| 10 | |
| 11 | build: export CGO_ENABLED=0 |
| 12 | build: clean |
| 13 | /usr/local/go/bin/go build -o fluxcd_reconciler main.go |
| 14 | |
| 15 | run: build |
| 16 | ./fluxcd_reconciler --port=8080 --kubeconfig=/Users/lekva/dev/src/pcloud/priv/kubeconfig-hetzner |
| 17 | |
| 18 | ## installer image |
| 19 | build_arm64: export CGO_ENABLED=0 |
| 20 | build_arm64: export GO111MODULE=on |
| 21 | build_arm64: export GOOS=linux |
| 22 | build_arm64: export GOARCH=arm64 |
| 23 | build_arm64: |
| 24 | /usr/local/go/bin/go build -o fluxcd_reconciler_arm64 main.go |
| 25 | |
| 26 | build_amd64: export CGO_ENABLED=0 |
| 27 | build_amd64: export GO111MODULE=on |
| 28 | build_amd64: export GOOS=linux |
| 29 | build_amd64: export GOARCH=amd64 |
| 30 | build_amd64: |
| 31 | /usr/local/go/bin/go build -o fluxcd_reconciler_amd64 main.go |
| 32 | |
| 33 | push_arm64: clean build_arm64 |
| 34 | mkdir tmp |
| 35 | cp -r ../../charts tmp/ |
| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 36 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/fluxcd-reconciler:arm64 . |
| Giorgi Lekveishvili | 2df23db | 2023-12-14 07:55:22 +0400 | [diff] [blame] | 37 | rm -rf tmp |
| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 38 | $(podman) push $(repo_name)/fluxcd-reconciler:arm64 |
| Giorgi Lekveishvili | 2df23db | 2023-12-14 07:55:22 +0400 | [diff] [blame] | 39 | |
| 40 | push_amd64: clean build_amd64 |
| 41 | mkdir tmp |
| 42 | cp -r ../../charts tmp/ |
| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 43 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/fluxcd-reconciler:amd64 . |
| Giorgi Lekveishvili | 2df23db | 2023-12-14 07:55:22 +0400 | [diff] [blame] | 44 | rm -rf tmp |
| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 45 | $(podman) push $(repo_name)/fluxcd-reconciler:amd64 |
| Giorgi Lekveishvili | 2df23db | 2023-12-14 07:55:22 +0400 | [diff] [blame] | 46 | |
| 47 | push: push_arm64 push_amd64 |
| gio | 43b0f42 | 2024-08-21 10:40:13 +0400 | [diff] [blame] | 48 | $(podman) manifest create $(repo_name)/fluxcd-reconciler:latest $(repo_name)/fluxcd-reconciler:arm64 $(repo_name)/fluxcd-reconciler:amd64 |
| 49 | $(podman) manifest push $(repo_name)/fluxcd-reconciler:latest $(manifest_dest) |
| 50 | $(podman) manifest rm $(repo_name)/fluxcd-reconciler:latest |