Update installer to handle dev and prod repos
oginstaller/pipeline/head There was a failure building this commit
Details
oginstaller/pipeline/head There was a failure building this commit
Details
parent
1a54a31fe0
commit
4789cddbfc
|
@ -6,6 +6,7 @@ import requests # Importar el módulo requests
|
|||
import time # Importar time para simular el progreso
|
||||
import threading # Importar threading para leer el log en tiempo real
|
||||
import socket
|
||||
import sys # Importar sys para leer los argumentos del script
|
||||
|
||||
CONFIGS_DIR = "/tmp/oginstall"
|
||||
os.makedirs(CONFIGS_DIR, exist_ok=True)
|
||||
|
@ -29,8 +30,11 @@ def get_network_interfaces():
|
|||
def get_available_versions():
|
||||
"""Obtiene la lista de versiones desde el archivo JSON remoto."""
|
||||
try:
|
||||
url = "https://ognproject.evlt.uma.es/debian-opengnsys/versions.json"
|
||||
# Redirigir la salida de la descarga a /dev/null
|
||||
# Determinar la URL según el argumento recibido
|
||||
if len(sys.argv) > 1 and sys.argv[1].lower() == "devel":
|
||||
url = "https://ognproject.evlt.uma.es/debian-opengnsys/versions-dev.json"
|
||||
else:
|
||||
url = "https://ognproject.evlt.uma.es/debian-opengnsys/versions-prod.json"
|
||||
response = requests.get(url, timeout=10)
|
||||
response.raise_for_status() # Lanza una excepción si la respuesta no es 200 OK
|
||||
data = response.json()
|
||||
|
@ -459,7 +463,11 @@ class MyApp(npyscreen.NPSAppManaged):
|
|||
# Añadir el repositorio
|
||||
try:
|
||||
selected_tag = self.selected_tag # Obtener el tag seleccionado
|
||||
repo_line = f'deb http://ognproject.evlt.uma.es/debian-opengnsys/opengnsys-devel/{selected_tag} noble main'
|
||||
# Determinar el valor de repo_line según el argumento recibido
|
||||
if len(sys.argv) > 1 and sys.argv[1].lower() == "devel":
|
||||
repo_line = f'deb http://ognproject.evlt.uma.es/debian-opengnsys/opengnsys-devel/{selected_tag} noble main'
|
||||
else:
|
||||
repo_line = f'deb http://ognproject.evlt.uma.es/debian-opengnsys/opengnsys/{selected_tag} noble main'
|
||||
with open('/etc/apt/sources.list.d/opengnsys.list', 'w') as repo_file:
|
||||
repo_file.write(repo_line + '\n')
|
||||
except Exception:
|
||||
|
|
|
@ -7,8 +7,11 @@ BRANCH=${BRANCH:-main}
|
|||
GIT_SSL_NO_VERIFY=1
|
||||
GIT_REPO="https://ognproject.evlt.uma.es/gitea/api/v1/repos/opengnsys/oginstaller/archive/$BRANCH.zip"
|
||||
export GIT_SSL_NO_VERIFY
|
||||
DEVEL=$1
|
||||
|
||||
|
||||
if [ "$DEVEL" == "devel" ]; then
|
||||
INSTALL_DEVEL=1
|
||||
fi
|
||||
|
||||
install_packages() {
|
||||
apt-get update
|
||||
|
@ -43,7 +46,11 @@ extract_installer() {
|
|||
|
||||
create_questions() {
|
||||
echo "Creating questions..."
|
||||
python3 /tmp/oginstall/oginstaller-v3.py
|
||||
if [ $INSTALL_DEVEL ] ; then
|
||||
python3 /tmp/oginstall/oginstaller-v3.py devel
|
||||
else
|
||||
python3 /tmp/oginstall/oginstaller-v3.py
|
||||
fi
|
||||
deactivate
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue