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