Files
oc-deploy/k8s/start.sh

30 lines
815 B
Bash
Raw Normal View History

2025-03-27 13:21:52 +01:00
#!/bin/bash
mode=${1:-dev}
branch=${2:-main}
2026-01-12 13:35:25 +01:00
clustername=${3:-opencloud}
2026-01-27 16:04:45 +01:00
path=${4:-.}
port=${5:-80}
portTLS=${6:-443}
2025-03-27 13:21:52 +01:00
2025-04-01 10:13:55 +02:00
if [ ! -d "oc-k8s" ]; then
2025-03-27 13:21:52 +01:00
echo "Cloning repository: $repo_name"
git clone "https://cloud.o-forge.io/core/oc-k8s.git"
if [ $? -ne 0 ]; then
echo "Error cloning oc-k8s"
exit 1
fi
fi
2026-01-12 13:35:25 +01:00
cp -rf ./datas/$clustername ./oc-k8s/opencloud/charts/mongodb/start_files
2025-03-27 13:21:52 +01:00
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
2026-01-12 13:35:25 +01:00
cd "oc-k8s" && git checkout main && git pull
2025-03-27 13:21:52 +01:00
2026-01-27 16:04:45 +01:00
if [ -f "./conf/$clustername.conf" ]; then
oc-k8s create values -r $clustername -f $path -c "./conf/$clustername.conf"
else
oc-k8s create values -r $clustername -f $path
fi
oc-k8s install
oc-k8s start -f $path -r $clustername -n $clustername -t $mode -b $branch -p $port -P $portTLS