Component installer downloads specific release

- Python script gets tags from repo
pull/1/head
Nicolas Arenas 2024-11-14 01:17:30 +01:00
parent 52e1c2f5a8
commit 520b2861fc
1 changed files with 16 additions and 8 deletions

View File

@ -87,6 +87,15 @@ EOF
}
function git_checkout_relaase() {
git clone --no-checkout "$1" "$2"
cd "$2" || exit
git checkout tags/"$3"
cd - || exit
}
echo ======================================== > /etc/issue
echo "OpenGnSys Installer" >> /etc/issue
echo "Componentes instalados:" >> /etc/issue
@ -106,10 +115,9 @@ do
case $component in
ogCore)
echo "Instalando ogCore..."
OGCORE_BRANCH=main
OGCORE_BRANCH=$(jq -r '.container_version' /opt/opengnsys/ogCore/installer/config.json)
container_version=$(jq -r '.container_version' /opt/opengnsys/ogCore/installer/config.json)
git clone --branch "$OGCORE_BRANCH" "$OGCORE_REPO" "$component_dir/repo"
# Copy the docker-compose-deploy.yml file to /opt/opengnsys/ogCore/etc/
git_checkout_relaase "$OGCORE_REPO" "$component_dir/repo" "$OGCORE_BRANCH"
mkdir -p $component_dir/etc/
mkdir -p $component_dir/bin/
cp provision_ogcore.sh $component_dir/bin/
@ -122,28 +130,28 @@ do
;;
ogGui)
echo "Instalando ogGui..."
OGGUI_BRANCH=main
OGGUI_BRANCH=$(jq -r '.container_version' /opt/opengnsys/ogGui/installer/config.json)
mkdir -p $component_dir/bin
cp provision_oggui.sh $component_dir/bin/
chmod 755 $component_dir/bin/provision_oggui.sh
git clone --branch "$OGGUI_BRANCH" "$OGGUI_REPO" "$component_dir/repo"
git_checkout_relaase "$OGGUI_REPO" "$component_dir/repo" "$OGGUI_BRANCH"
echo - ogGui >> /etc/issue
install_docker
install_oggui_docker
;;
ogDhcp)
echo "Instalando ogDhcp..."
git clone "$OGDHCP_REPO" "$component_dir/repo"
git_checkout_relaase "$OGDHCP_REPO" "$component_dir/repo" "$OGCORE_BRANCH"
echo - ogDhcp >> /etc/issue
;;
ogBoot)
echo "Instalando ogBoot..."
git clone "$OGBOOT_REPO" "$component_dir/repo"
git_checkout_relaase "$OGBOOT_REPO" "$component_dir/repo" "$OGCORE_BRANCH"
echo - ogBoot >> /etc/issue
;;
ogRepository)
echo "Instalando ogRepository..."
git clone "$OGREPOSITORY_REPO" "$component_dir/repo"
git_checkout_relaase "$OGREPOSITORY_REPO" "$component_dir/repo" "$OGCORE_BRANCH"
echo - ogRepository >> /etc/issue
;;
*)