oneuptime/HelmChart/Tests/index.sh

45 lines
1.4 KiB
Bash
Raw Normal View History

2023-12-30 14:19:49 +00:00
# Install MicroK8s
2023-12-30 14:22:47 +00:00
sudo snap install microk8s --classic
sudo microk8s status --wait-ready
2023-12-30 14:19:49 +00:00
# Add kubectl and helm aliases
2023-12-30 14:22:47 +00:00
sudo echo "alias kubectl='microk8s kubectl'" >> ~/.bash_aliases
sudo echo "alias helm='microk8s helm3'" >> ~/.bash_aliases
2023-12-30 14:19:49 +00:00
source ~/.bash_aliases
2023-12-30 14:19:49 +00:00
# Enable MicroK8s addons
2023-12-30 14:22:47 +00:00
sudo microk8s enable dashboard
sudo microk8s enable dns
sudo microk8s enable hostpath-storage
2023-12-30 14:19:49 +00:00
echo "MicroK8s is ready. Installing OneUptime"
# Get pods
sudo microk8s kubectl get pods
2023-12-30 14:19:49 +00:00
# Install OneUptime
2023-12-30 18:23:24 +00:00
sudo microk8s helm install oneuptime ../../HelmChart/Public/oneuptime -f ../../HelmChart/Public/oneuptime/values.yaml -f ./ci-values.yaml
2023-12-30 14:19:49 +00:00
# echo "OneUptime is installed. Waiting for it to be ready. Checking status in 20 mins once things settle down..."
# sleep 20m
# # Wait for OneUptime to be ready
# timeout 30m bash -c '
# endtime=$((SECONDS+600))
# while [ $SECONDS -lt $endtime ]; do
# if sudo microk8s kubectl wait pod --all --for=condition=Ready --namespace=default --timeout=5m; then
# echo "All pods are ready"
# exit 0
# fi
# echo "Some pods are not ready yet. Getting status of all the pods: "
# sudo microk8s kubectl get pods --all-namespaces
# sleep 1m
# done
# echo "Timeout reached. Some pods failed to start"
# exit 1
# '
2023-12-30 14:19:49 +00:00
# Once it's ready. Run helm test.
2023-12-30 22:50:27 +00:00
# sudo microk8s helm test oneuptime