21 lines
575 B
Bash
Executable File
21 lines
575 B
Bash
Executable File
#!/bin/bash
|
|
mode=${1:-dev}
|
|
branch=${2:-main}
|
|
clustername=${3:-opencloud}
|
|
|
|
if [ ! -d "oc-k8s" ]; then
|
|
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
|
|
|
|
cp -rf ./datas/$clustername ./oc-k8s/opencloud/charts/mongodb/start_files
|
|
|
|
echo "Repository 'oc-k8s' already exists. Pulling latest changes..."
|
|
cd "oc-k8s" && git checkout main && git pull
|
|
|
|
export CLUSTER_NAME=$clustername ./oc-k8s.sh create values $mode
|
|
./oc-k8s.sh start $mode $branch |