@@ -7,51 +7,67 @@ CONFIG_DIR := $(shell dirname $(REPO_CONFIG_LOCATION))
77CHART_DIRS := $(wildcard $(REPO_BASE_DIR ) /charts/* /)
88
99.PHONY : .check-helmfile-installed
10- .check-helmfile-installed :
10+ .check-helmfile-installed : # # Checks if helmfile is installed
1111 @if ! command -v helmfile > /dev/null 2>&1 ; then \
1212 echo " 'helmfile' is not installed. Install it to continue ..." ; \
1313 fi
1414
15- helmfile.yaml : simcore-charts/helmfile.yaml
15+ helmfile.yaml : simcore-charts/helmfile.yaml # # Copies the helmfile.yaml to the charts directory
1616 cp $(CONFIG_DIR ) /$@ $(REPO_BASE_DIR ) /charts/helmfile.yaml
1717
18- simcore-charts/helmfile.yaml :
18+ simcore-charts/helmfile.yaml : # # Copies the simcore helmfile to the charts directory
1919 cp $(CONFIG_DIR ) /helmfile.simcore.yaml $(REPO_BASE_DIR ) /charts/$@
2020
2121.PHONY : helmfile-lint
22- helmfile-lint : .check-helmfile-installed helmfile.yaml
22+ helmfile-lint : .check-helmfile-installed helmfile.yaml # # Lints the helmfile
2323 set -a; source $(REPO_CONFIG_LOCATION ) ; set +a; \
2424 helmfile lint
2525
2626.PHONY : .helmfile-local-post-install
27- .helmfile-local-post-install :
27+ .helmfile-local-post-install : # # Post install steps for local helmfile deployment
2828 @$(MAKE ) -s configure-local-hosts
2929 @echo " " ;
30- @echo " Cluster has been deployed locally: http ://$( MACHINE_FQDN) " ;
30+ @echo " Cluster has been deployed locally: https ://$( MACHINE_FQDN) " ;
3131 @echo " For secure connections self-signed certificates are used." ;
32- @echo " Install their root-ca certificate in your system for smooth experience." ;
33- @echo " For insecure connections make sure to disable automatic https redirects in your browser." ;
32+ @echo " " ;
3433
3534.PHONY : helmfile-apply
36- helmfile-apply : .check-helmfile-installed helmfile.yaml
35+ helmfile-apply : .check-helmfile-installed helmfile.yaml # # Applies the helmfile configuration
3736 set -a; source $(REPO_CONFIG_LOCATION ) ; set +a; \
3837 helmfile -f $(REPO_BASE_DIR ) /charts/helmfile.yaml apply
3938
4039 @if [ "$(MACHINE_FQDN)" = "osparc.local" ]; then \
4140 $(MAKE) -s .helmfile-local-post-install; \
4241 fi
4342
43+ .PHONY : helmfile-sync
44+ helmfile-sync : .check-helmfile-installed helmfile.yaml # # Syncs the helmfile configuration (use `helmfile-apply` to deploy the app)
45+ set -a; source $(REPO_CONFIG_LOCATION ) ; set +a; \
46+ helmfile -f $(REPO_BASE_DIR ) /charts/helmfile.yaml sync
47+
48+ @if [ "$(MACHINE_FQDN)" = "osparc.local" ]; then \
49+ $(MAKE) -s .helmfile-local-post-install; \
50+ fi
51+
52+
4453.PHONY : configure-local-hosts
45- configure-local-hosts :
46- @echo " Addings $( MACHINE_FQDN) hosts to /etc/hosts ..."
54+ configure-local-hosts : # # Adds local hosts entries for the machine
55+ @echo " Adding $( MACHINE_FQDN) hosts to /etc/hosts ..."
4756 @grep -q ' 127.0.0.1 k8s.monitoring.$(MACHINE_FQDN)' /etc/hosts || echo ' 127.0.0.1 k8s.monitoring.$(MACHINE_FQDN)' | sudo tee -a /etc/hosts
4857
4958.PHONY : helmfile-diff
50- helmfile-diff : .check-helmfile-installed helmfile.yaml
59+ helmfile-diff : .check-helmfile-installed helmfile.yaml # # Shows the differences that would be applied by helmfile
5160 @set -a; source $(REPO_CONFIG_LOCATION ) ; set +a; \
5261 helmfile -f $(REPO_BASE_DIR ) /charts/helmfile.yaml diff
5362
5463.PHONY : helmfile-delete
55- helmfile-delete : .check-helmfile-installed helmfile.yaml
64+ helmfile-delete : .check-helmfile-installed helmfile.yaml # # Deletes the helmfile configuration
5665 @set -a; source $(REPO_CONFIG_LOCATION ) ; set +a; \
5766 helmfile -f $(REPO_BASE_DIR ) /charts/helmfile.yaml delete
67+
68+ .PHONY : up
69+ up : helmfile-apply # # Start the stack
70+
71+ .PHONY : leave
72+ leave : # # Leaves kind cluster
73+ kind delete clusters kind
0 commit comments