blob: 1c831384b093d43df39747bff5181d27d69bd99b [file] [log] [blame]
DTabidze52593392024-03-08 12:53:20 +04001repo_name ?= dtabidze
2podman ?= docker
Giorgi Lekveishvili0c6b3242024-03-14 15:31:08 +04003ifeq ($(podman), podman)
4manifest_dest=docker://docker.io/$(repo_name)/pcloud-installer:latest
5endif
DTabidze52593392024-03-08 12:53:20 +04006
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +04007clean:
8 rm -rf tmp
9 rm -f server_*
10 rm -f pcloud
giolekva716efb92022-05-07 23:08:58 +040011
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040012push_fluxcd_arm64:
DTabidze52593392024-03-08 12:53:20 +040013 $(podman) build --file=Dockerfile.flux --tag=$(repo_name)/flux:latest . --platform=linux/arm64
14 docker push $(repo_name)/flux:latest
giolekva9eacb1a2022-05-21 13:57:19 +040015
Giorgi Lekveishvilia1e77902023-11-06 14:48:27 +040016build: export CGO_ENABLED=0
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040017build: clean
Giorgi Lekveishvili46743d42023-12-10 15:47:23 +040018 /usr/local/go/bin/go build -o pcloud cmd/*.go
19
20test: export CGO_ENABLED=0
21test:
Giorgi Lekveishvili186eae52024-02-15 14:21:41 +040022 /usr/local/go/bin/go test ./...
giolekva9eacb1a2022-05-21 13:57:19 +040023
24bootstrap:
Giorgi Lekveishvilia1e77902023-11-06 14:48:27 +040025 ./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
giolekva8aa73e82022-07-09 11:34:39 +040026
27create_env:
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +040028 ./pcloud --kubeconfig=../../priv/kubeconfig create-env --admin-priv-key=/Users/lekva/.ssh/id_rsa --name=lekva --ip=192.168.0.211 --admin-username=gio
giolekva8aa73e82022-07-09 11:34:39 +040029
Giorgi Lekveishvili23ef7f82023-05-26 11:57:48 +040030rpuppy:
Giorgi Lekveishvili7fb28bf2023-06-24 19:51:16 +040031 ./pcloud --kubeconfig=../../priv/kubeconfig install --ssh-key=/Users/lekva/.ssh/id_rsa --app=rpuppy --repo-addr=ssh://localhost:2222/lekva
Giorgi Lekveishvili7efe22f2023-05-30 13:01:53 +040032
33appmanager:
Giorgi Lekveishvilief21c132024-01-17 18:57:58 +040034 ./pcloud --kubeconfig=../../priv/kubeconfig appmanager --ssh-key=/Users/lekva/.ssh/id_ed25519 --repo-addr=ssh://localhost:2222/config --port=9090 --app-repo-addr=http://localhost:8080
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040035
Giorgi Lekveishvili12850ee2023-06-22 13:11:17 +040036welc:
Giorgi Lekveishvili46743d42023-12-10 15:47:23 +040037 ./pcloud --kubeconfig=../../priv/kubeconfig welcome --ssh-key=/Users/lekva/.ssh/id_rsa --repo-addr=ssh://192.168.0.210/config --port=9090
38
39env:
40 ./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 Lekveishvili12850ee2023-06-22 13:11:17 +040041
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040042
43
44
45## installer image
46build_arm64: export CGO_ENABLED=0
47build_arm64: export GO111MODULE=on
48build_arm64: export GOOS=linux
49build_arm64: export GOARCH=arm64
50build_arm64:
Giorgi Lekveishvili46743d42023-12-10 15:47:23 +040051 /usr/local/go/bin/go build -o server_arm64 cmd/*.go
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040052
Giorgi Lekveishvili94cda9d2023-07-20 10:16:09 +040053build_amd64: export CGO_ENABLED=0
54build_amd64: export GO111MODULE=on
55build_amd64: export GOOS=linux
56build_amd64: export GOARCH=amd64
57build_amd64:
Giorgi Lekveishvili46743d42023-12-10 15:47:23 +040058 /usr/local/go/bin/go build -o server_amd64 cmd/*.go
Giorgi Lekveishvili94cda9d2023-07-20 10:16:09 +040059
60push_arm64: clean build_arm64
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040061 mkdir tmp
62 cp -r ../../charts tmp/
DTabidze52593392024-03-08 12:53:20 +040063 $(podman) build --platform linux/arm64 --tag=$(repo_name)/pcloud-installer:arm64 .
Giorgi Lekveishvili0ccd1482023-06-21 15:02:24 +040064 rm -rf tmp
DTabidze52593392024-03-08 12:53:20 +040065 $(podman) push $(repo_name)/pcloud-installer:arm64
Giorgi Lekveishvili94cda9d2023-07-20 10:16:09 +040066
67push_amd64: clean build_amd64
68 mkdir tmp
69 cp -r ../../charts tmp/
DTabidze52593392024-03-08 12:53:20 +040070 $(podman) build --platform linux/amd64 --tag=$(repo_name)/pcloud-installer:amd64 .
Giorgi Lekveishvili94cda9d2023-07-20 10:16:09 +040071 rm -rf tmp
DTabidze52593392024-03-08 12:53:20 +040072 $(podman) push $(repo_name)/pcloud-installer:amd64
Giorgi Lekveishvili94cda9d2023-07-20 10:16:09 +040073
74push: push_arm64 push_amd64
DTabidze52593392024-03-08 12:53:20 +040075 $(podman) manifest create $(repo_name)/pcloud-installer:latest $(repo_name)/pcloud-installer:arm64 $(repo_name)/pcloud-installer:amd64
Giorgi Lekveishvili0c6b3242024-03-14 15:31:08 +040076 $(podman) manifest push $(repo_name)/pcloud-installer:latest $(manifest_dest)
DTabidze52593392024-03-08 12:53:20 +040077 $(podman) manifest rm $(repo_name)/pcloud-installer:latest