| gio | fc441e3 | 2024-11-11 16:26:14 +0400 | [diff] [blame] | 1 | repo_name ?= giolekva |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 2 | podman ?= docker |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame] | 3 | docker_flags=--provenance=false --sbom=false |
| Giorgi Lekveishvili | 0c6b324 | 2024-03-14 15:31:08 +0400 | [diff] [blame] | 4 | ifeq ($(podman), podman) |
| 5 | manifest_dest=docker://docker.io/$(repo_name)/pcloud-installer:latest |
| 6 | endif |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 7 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 8 | clean: |
| 9 | rm -rf tmp |
| 10 | rm -f server_* |
| 11 | rm -f pcloud |
| giolekva | 716efb9 | 2022-05-07 23:08:58 +0400 | [diff] [blame] | 12 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 13 | push_fluxcd_arm64: |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 14 | $(podman) build --file=Dockerfile.flux --tag=$(repo_name)/flux:latest . --platform=linux/arm64 |
| 15 | docker push $(repo_name)/flux:latest |
| giolekva | 9eacb1a | 2022-05-21 13:57:19 +0400 | [diff] [blame] | 16 | |
| gio | b1d3bd7 | 2025-05-15 07:20:06 +0400 | [diff] [blame] | 17 | format: |
| 18 | go run cuelang.org/go/cmd/cue fmt app_configs/*.cue |
| 19 | |
| Giorgi Lekveishvili | a1e7790 | 2023-11-06 14:48:27 +0400 | [diff] [blame] | 20 | build: export CGO_ENABLED=0 |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 21 | build: clean |
| Giorgi Lekveishvili | 46743d4 | 2023-12-10 15:47:23 +0400 | [diff] [blame] | 22 | /usr/local/go/bin/go build -o pcloud cmd/*.go |
| 23 | |
| 24 | test: export CGO_ENABLED=0 |
| 25 | test: |
| Giorgi Lekveishvili | 186eae5 | 2024-02-15 14:21:41 +0400 | [diff] [blame] | 26 | /usr/local/go/bin/go test ./... |
| giolekva | 9eacb1a | 2022-05-21 13:57:19 +0400 | [diff] [blame] | 27 | |
| Giorgi Lekveishvili | ee15ee2 | 2024-03-28 12:35:10 +0400 | [diff] [blame] | 28 | test: export CGO_ENABLED=0 |
| 29 | testv: |
| 30 | /usr/local/go/bin/go test -v ./... |
| 31 | |
| giolekva | 9eacb1a | 2022-05-21 13:57:19 +0400 | [diff] [blame] | 32 | bootstrap: |
| gio | 3cdee59 | 2024-04-17 10:15:56 +0400 | [diff] [blame] | 33 | ./pcloud --kubeconfig=../../priv/kubeconfig-hetzner bootstrap --env-name=dodo --charts-dir=../../charts --admin-pub-key=/Users/lekva/.ssh/id_rsa.pub --from-ip=192.168.100.210 --to-ip=192.168.100.240 --storage-dir=/pcloud-storage/longhorn --public-ip=135.181.48.180,65.108.39.172 |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 34 | |
| 35 | create_env: |
| Giorgi Lekveishvili | 7fb28bf | 2023-06-24 19:51:16 +0400 | [diff] [blame] | 36 | ./pcloud --kubeconfig=../../priv/kubeconfig create-env --admin-priv-key=/Users/lekva/.ssh/id_rsa --name=lekva --ip=192.168.0.211 --admin-username=gio |
| giolekva | 8aa73e8 | 2022-07-09 11:34:39 +0400 | [diff] [blame] | 37 | |
| Giorgi Lekveishvili | 7efe22f | 2023-05-30 13:01:53 +0400 | [diff] [blame] | 38 | appmanager: |
| gio | 36b23b3 | 2024-08-25 12:20:54 +0400 | [diff] [blame] | 39 | ./pcloud --kubeconfig=../../priv/kubeconfig-hetzner appmanager --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://10.43.196.174/config --port=9090 --headscale-api-addr=http://10.43.193.154 # --app-repo-addr=http://localhost:8080 |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 40 | |
| gio | 0eaf271 | 2024-04-14 13:08:46 +0400 | [diff] [blame] | 41 | dodo-app: |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 42 | ./pcloud --kubeconfig=../../priv/kubeconfig-hetzner dodo-app --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://10.43.196.174/test |
| gio | 0eaf271 | 2024-04-14 13:08:46 +0400 | [diff] [blame] | 43 | |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 44 | welc: |
| Davit Tabidze | fdf3b9b | 2024-07-30 21:01:08 +0400 | [diff] [blame] | 45 | ./pcloud --kubeconfig=../../priv/kubeconfig-hetzner welcome --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://10.43.196.174/config --port=9090 |
| Giorgi Lekveishvili | 46743d4 | 2023-12-10 15:47:23 +0400 | [diff] [blame] | 46 | |
| 47 | env: |
| 48 | ./pcloud --kubeconfig=../../priv/kubeconfig-hetzner envmanager --ssh-key=/Users/lekva/.ssh/id_rsa --repo-addr=192.168.100.210:22 --repo-name=config --port=9090 |
| Giorgi Lekveishvili | 12850ee | 2023-06-22 13:11:17 +0400 | [diff] [blame] | 49 | |
| gio | 308105e | 2024-04-19 13:12:13 +0400 | [diff] [blame] | 50 | rewrite: |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 51 | ./pcloud rewrite --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://10.43.196.174/config |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 52 | |
| Davit Tabidze | 207ce08 | 2024-04-09 19:15:25 +0400 | [diff] [blame] | 53 | launcher: |
| gio | f884341 | 2024-05-22 16:38:05 +0400 | [diff] [blame] | 54 | ./pcloud launcher --port=9090 --logout-url=http://localhost:8080 --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://10.43.196.174/config |
| Davit Tabidze | 207ce08 | 2024-04-09 19:15:25 +0400 | [diff] [blame] | 55 | |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 56 | ## installer image |
| 57 | build_arm64: export CGO_ENABLED=0 |
| 58 | build_arm64: export GO111MODULE=on |
| 59 | build_arm64: export GOOS=linux |
| 60 | build_arm64: export GOARCH=arm64 |
| 61 | build_arm64: |
| Giorgi Lekveishvili | 46743d4 | 2023-12-10 15:47:23 +0400 | [diff] [blame] | 62 | /usr/local/go/bin/go build -o server_arm64 cmd/*.go |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 63 | |
| Giorgi Lekveishvili | 94cda9d | 2023-07-20 10:16:09 +0400 | [diff] [blame] | 64 | build_amd64: export CGO_ENABLED=0 |
| 65 | build_amd64: export GO111MODULE=on |
| 66 | build_amd64: export GOOS=linux |
| 67 | build_amd64: export GOARCH=amd64 |
| 68 | build_amd64: |
| Giorgi Lekveishvili | 46743d4 | 2023-12-10 15:47:23 +0400 | [diff] [blame] | 69 | /usr/local/go/bin/go build -o server_amd64 cmd/*.go |
| Giorgi Lekveishvili | 94cda9d | 2023-07-20 10:16:09 +0400 | [diff] [blame] | 70 | |
| 71 | push_arm64: clean build_arm64 |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 72 | mkdir tmp |
| 73 | cp -r ../../charts tmp/ |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame] | 74 | $(podman) build --platform linux/arm64 --tag=$(repo_name)/pcloud-installer:arm64 $(docker_flags) . |
| Giorgi Lekveishvili | 0ccd148 | 2023-06-21 15:02:24 +0400 | [diff] [blame] | 75 | rm -rf tmp |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 76 | $(podman) push $(repo_name)/pcloud-installer:arm64 |
| Giorgi Lekveishvili | 94cda9d | 2023-07-20 10:16:09 +0400 | [diff] [blame] | 77 | |
| 78 | push_amd64: clean build_amd64 |
| 79 | mkdir tmp |
| 80 | cp -r ../../charts tmp/ |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame] | 81 | $(podman) build --platform linux/amd64 --tag=$(repo_name)/pcloud-installer:amd64 $(docker_flags) . |
| Giorgi Lekveishvili | 94cda9d | 2023-07-20 10:16:09 +0400 | [diff] [blame] | 82 | rm -rf tmp |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 83 | $(podman) push $(repo_name)/pcloud-installer:amd64 |
| Giorgi Lekveishvili | 94cda9d | 2023-07-20 10:16:09 +0400 | [diff] [blame] | 84 | |
| 85 | push: push_arm64 push_amd64 |
| DTabidze | 5259339 | 2024-03-08 12:53:20 +0400 | [diff] [blame] | 86 | $(podman) manifest create $(repo_name)/pcloud-installer:latest $(repo_name)/pcloud-installer:arm64 $(repo_name)/pcloud-installer:amd64 |
| gio | 2446de0 | 2025-04-11 11:20:39 +0400 | [diff] [blame] | 87 | $(podman) manifest push --purge $(repo_name)/pcloud-installer:latest $(manifest_dest) |