oc-deploy can now deploy Demo
This commit is contained in:
32
k8s/start.sh
32
k8s/start.sh
@@ -1,30 +1,22 @@
|
||||
#!/bin/bash
|
||||
mode=${1:-dev}
|
||||
mode=${1:-all}
|
||||
branch=${2:-main}
|
||||
clustername=${3:-opencloud}
|
||||
path=${4:-.}
|
||||
port=${5:-80}
|
||||
portTLS=${6:-443}
|
||||
|
||||
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
|
||||
echo "Create values for $clustername"
|
||||
|
||||
if [ -f "./conf/$clustername.conf" ]; then
|
||||
oc-k8s create values -r $clustername -f $path -c "./conf/$clustername.conf"
|
||||
oc-k8s create values -n $clustername -r $clustername -f $path -c "./conf/$clustername.conf"
|
||||
else
|
||||
oc-k8s create values -r $clustername -f $path
|
||||
oc-k8s create values -n $clustername -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
|
||||
echo "Start $clustername"
|
||||
|
||||
oc-k8s start -f $path -r $clustername -n $clustername -t $mode -b $branch
|
||||
|
||||
#if [ -d "./datas/$clustername" ]; then
|
||||
# echo "Import datas for $clustername"
|
||||
# oc-k8s upgrade db -d opencloud -r $clustername -n $clustername -f ./datas/$clustername
|
||||
#fi
|
||||
Reference in New Issue
Block a user