1- all : render deploy # # renders and deploys all templates into the current k8s cluster
1+ NAMESPACE =edgefarm-applications
2+ all : render deploy helm # # renders and deploys all templates into the current k8s cluster
23render : traits-render components-render # # renders all templates
34apply : traits-apply components-apply # # applies all templates
45deploy : traits-deploy components-deploy # # deploys all templates
@@ -17,23 +18,43 @@ traits-apply: ## applies all traits using vela cli
1718 @vela def apply cue/traits/edgefarm-storage-trait.cue
1819
1920traits-deploy : # # deploys all traits using kubectl
20- kubectl apply -n vela-system -f manifests/vela-caps/traits/edgefarm-network-trait.yaml
21- kubectl apply -n vela-system -f manifests/vela-caps/traits/edgefarm-storage-trait.yaml
21+ kubectl apply -n $( NAMESPACE ) -f manifests/vela-caps/traits/edgefarm-network-trait.yaml
22+ kubectl apply -n $( NAMESPACE ) -f manifests/vela-caps/traits/edgefarm-storage-trait.yaml
2223
2324components-render : # # renders all components
2425 @vela def vet cue/components/edgefarm-applications.cue
2526 @vela def render cue/components/edgefarm-applications.cue -o manifests/vela-caps/components/edgefarm-applications.yaml
2627components-apply : # # applies all components using vela cli
2728 @vela def apply cue/components/edgefarm-applications.cue
2829components-deploy : # # deploys all components using kubectl
29- kubectl apply -n vela-system -f manifests/vela-caps/components/edgefarm-applications.yaml
30-
30+ kubectl apply -n $(NAMESPACE ) -f manifests/vela-caps/components/edgefarm-applications.yaml
31+
32+ helm : # # generate helm chart. Version is incremented using semantic-release and github actions
33+ $(eval TEMPD := $(shell mktemp -d) )
34+ $(eval ROOTPWD := $(shell pwd) )
35+ @cd $(TEMPD )
36+ @helmify -f $(ROOTPWD ) /manifests/vela-caps/components/edgefarm-applications.yaml -f $(ROOTPWD ) /manifests/vela-caps/traits/edgefarm-storage-trait.yaml -f $(ROOTPWD ) /manifests/vela-caps/traits/edgefarm-network-trait.yaml $(TEMPD ) /edgefarm-applications
37+ @sed -i ' s/name: {{ include "edgefarm-applications.fullname" . }}-applications/name: edgefarm-applications/g' $(TEMPD ) /edgefarm-applications/templates/edgefarm-applications.yaml
38+ @sed -i ' s/name: {{ include "edgefarm-applications.fullname" . }}-network/name: edgefarm-network/g' $(TEMPD ) /edgefarm-applications/templates/edgefarm-network-trait.yaml
39+ @sed -i ' s/name: {{ include "edgefarm-applications.fullname" . }}-storage/name: edgefarm-storage/g' $(TEMPD ) /edgefarm-applications/templates/edgefarm-storage-trait.yaml
40+ @cp -r $(TEMPD ) /edgefarm-applications/templates/* $(ROOTPWD ) /charts/edgefarm-applications/templates
41+ @rm -r $(TEMPD )
42+ @cd $(ROOTPWD )
43+ @helm dependency update charts/edgefarm-applications
3144
3245install-vela : # # install kubevela
33- @VELA_VERSION=v1.8.0
34- @curl -fsSl https://kubevela.io/script/install.sh | bash -s ${VELA_VERSION}
46+ # Make sure to also modify the version of vela-core in charts/edgefarm-applications/Chart.yaml
47+ @curl -fsSl https://kubevela.io/script/install.sh | bash -s v1.8.0
3548 @vela install
3649
50+ install-helmify : # # install helmify
51+ $(eval TEMPD := $(shell mktemp -d) )
52+ @curl -L https://github.com/arttor/helmify/releases/download/v0.4.5/helmify_Linux_x86_64.tar.gz -o $(TEMPD ) /helmify.tar.gz && \
53+ tar -xzf $(TEMPD ) /helmify.tar.gz -C /$(TEMPD ) && \
54+ mv $(TEMPD ) /helmify /usr/local/bin/helmify && \
55+ chmod +x /usr/local/bin/helmify
56+ @rm -r $(TEMPD )
57+
3758help : # # show help message
3859 @awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make [target]\033[36m\033[0m\n"} /^[$$()% 0-9a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m\t %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
3960
0 commit comments