Update CONFIG DIR Variable for systemd unit
oginstaller/pipeline/head There was a failure building this commit Details

working-installer
Nicolas Arenas 2024-11-13 21:21:37 +01:00
parent 50f2c60d31
commit d6d2df9855
1 changed files with 20 additions and 18 deletions

View File

@ -2,9 +2,27 @@
set -x set -x
# Paso 1: Seleccionar los componentes # Paso 1: Seleccionar los componentes
# Los componentes a instalar se encuentran en el directorio /tmp/opengnsys-installer-configs # Los componentes a instalar se encuentran en el directorio /tmp/opengnsys-installer-configs
# Set configuration # Set configuration
COMPONENTS="ogCore ogGui ogDhcp ogBoot ogRepository"
CONFIGS_DIR=/tmp/oginstall
# PAT_FILE=/opengnsys-installer/pat.txt
# PAT=$(cat $PAT_FILE | tr -d '\n\r\t')
# OPENGNSYS_BASE_URL="https://$PAT@ognproject.evlt.uma.es/gitea/opengnsys"
OPENGNSYS_BASE_URL="https://ognproject.evlt.uma.es/gitea/opengnsys"
OGBOOT_REPO="$OPENGNSYS_BASE_URL/ogboot.git"
OGCORE_REPO="$OPENGNSYS_BASE_URL/ogcore.git"
OGDHCP_REPO="$OPENGNSYS_BASE_URL/ogdhcp.git"
OGGUI_REPO="$OPENGNSYS_BASE_URL/oggui.git"
OGREPOSITORY_REPO="$OPENGNSYS_BASE_URL/ogrepo.git"
export GIT_SSL_NO_VERIFY=1
## Functions
function install_docker() { function install_docker() {
apt-get -y update apt-get -y update
apt-get -y install ca-certificates curl apt-get -y install ca-certificates curl
@ -28,7 +46,7 @@ Requires=docker.service
[Service] [Service]
WorkingDirectory=/opt/opengnsys/ogCore/repo/ WorkingDirectory=/opt/opengnsys/ogCore/repo/
ExecStart=/usr/bin/docker compose -f /opt/opengnsys/ogCore/etc/docker-compose-deploy.yml up ExecStart=/usr/bin/docker compose -f /opt/opengnsys/ogCore/etc/docker-compose-deploy.yml up
ExecStartPost=/opengnsys-installer/provision_ogcore.sh ExecStartPost=$CONFIGS_DIR/provision_ogcore.sh
ExecStop=/usr/bin/docker compose -f /opt/opengnsys/ogCore/etc/docker-compose-deploy.yml stop ExecStop=/usr/bin/docker compose -f /opt/opengnsys/ogCore/etc/docker-compose-deploy.yml stop
Restart=always Restart=always
@ -41,7 +59,6 @@ EOF
} }
function install_oggui_docker() { function install_oggui_docker() {
# Sacar la IP del ogCore de la configuración # Sacar la IP del ogCore de la configuración
oggui_version=$(jq -r '.container_version' /opt/opengnsys/ogGui/installer/config.json) oggui_version=$(jq -r '.container_version' /opt/opengnsys/ogGui/installer/config.json)
@ -70,21 +87,6 @@ EOF
} }
COMPONENTS="ogCore ogGui ogDhcp ogBoot ogRepository"
CONFIGS_DIR=/opengnsys-installer/
PAT_FILE=/opengnsys-installer/pat.txt
PAT=$(cat $PAT_FILE | tr -d '\n\r\t')
OPENGNSYS_BASE_URL="https://$PAT@ognproject.evlt.uma.es/gitea/opengnsys"
OGBOOT_REPO="$OPENGNSYS_BASE_URL/ogboot.git"
OGCORE_REPO="$OPENGNSYS_BASE_URL/ogcore.git"
OGDHCP_REPO="$OPENGNSYS_BASE_URL/ogdhcp.git"
OGGUI_REPO="$OPENGNSYS_BASE_URL/oggui.git"
OGREPOSITORY_REPO="$OPENGNSYS_BASE_URL/ogrepo.git"
export GIT_SSL_NO_VERIFY=1
echo ======================================== > /etc/issue echo ======================================== > /etc/issue
echo "OpenGnSys Installer" >> /etc/issue echo "OpenGnSys Installer" >> /etc/issue
echo "Componentes instalados:" >> /etc/issue echo "Componentes instalados:" >> /etc/issue