#!/bin/bash

if [ "$1" = "i" ]
then
	kubectl apply -f ./preparaNextCloud/nc-namespace.yaml
	kubectl apply -f ./preparaNextCloud/pv-local-mysql.yaml
	kubectl apply -f ./preparaNextCloud/pv-local-nextcloud.yaml
	helm install nextcloud nextcloud-chart/
else
	helm uninstall nextcloud 
	kubectl delete -f ./preparaNextCloud/nc-namespace.yaml
	kubectl delete -f ./preparaNextCloud/pv-local-mysql.yaml
	kubectl delete -f ./preparaNextCloud/pv-local-nextcloud.yaml
fi
