From 520b2861fc4850ba4815245122ddee7470bfba11 Mon Sep 17 00:00:00 2001 From: Nicolas Arenas Date: Thu, 14 Nov 2024 01:17:30 +0100 Subject: [PATCH] Component installer downloads specific release - Python script gets tags from repo --- component-installer/component-installer.sh | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/component-installer/component-installer.sh b/component-installer/component-installer.sh index 2119e83..2ee6757 100644 --- a/component-installer/component-installer.sh +++ b/component-installer/component-installer.sh @@ -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 ;; *)