refs #983 adds ogcore url to .env and removes some innecesaries config params in installer
parent
d34f1dd22e
commit
a98fd3ccf0
1
.env
1
.env
|
@ -17,7 +17,6 @@
|
|||
###> symfony/framework-bundle ###
|
||||
APP_ENV=dev
|
||||
APP_SECRET=d423d1302b974417d415b10bcde25767
|
||||
OGCORE_API_URL="https://172.17.8.90:8443"
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> doctrine/doctrine-bundle ###
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
{
|
||||
"ogCore_ServerIP": "172.17.8.82",
|
||||
"ogCore_Server": "opengnsys.es",
|
||||
"ogCore_Dir": "/opt/opengnsys",
|
||||
"ogBoot_Dir": "/opt/ogboot",
|
||||
"ogBoot_GitRepo": "ssh://git@ognproject.evlt.uma.es:21987/opengnsys/ogboot.git",
|
||||
"ogBootSambaUser": "opengnsys",
|
||||
"ogBootSambaPass": "og"
|
||||
}
|
||||
|
|
|
@ -17,14 +17,14 @@ with open(config_file, 'r') as f:
|
|||
config = json.load(f)
|
||||
|
||||
OGCORE_IP = config["ogCore_ServerIP"]
|
||||
OGCORE_SERVER = config["ogCore_Server"]
|
||||
INSTALL_OPENGNSYS_TARGET = config["ogCore_Dir"]
|
||||
INSTALL_OGBOOT_TARGET = config["ogBoot_Dir"]
|
||||
INSTALL_TARGET = config["ogBoot_Dir"]
|
||||
GIT_REPO = config["ogBoot_GitRepo"]
|
||||
INSTALL_OPENGNSYS_TARGET = "/opt/opengnsys"
|
||||
INSTALL_OGBOOT_TARGET = "/opt/ogboot"
|
||||
INSTALL_TARGET = "/opt/ogboot"
|
||||
GIT_REPO = "ssh://git@ognproject.evlt.uma.es:21987/opengnsys/ogboot.git"
|
||||
OPENGNSYS_CLIENT_USER = config["ogBootSambaUser"]
|
||||
OPENGNSYS_CLIENT_PASSWD = config["ogBootSambaPass"]
|
||||
|
||||
|
||||
OSDISTRIB = ""
|
||||
OSVERSION = ""
|
||||
IPXE_DIR = "/tmp/ogboot_ipxe"
|
||||
|
@ -267,7 +267,7 @@ def og_boot_create_dirs():
|
|||
exit(1)
|
||||
|
||||
def og_boot_symfony_install():
|
||||
global WORKDIR, INSTALL_OGBOOT_TARGET
|
||||
global WORKDIR, INSTALL_OGBOOT_TARGET, OGCORE_IP
|
||||
logger.info("Creating Symfony application skeleton...")
|
||||
|
||||
try:
|
||||
|
@ -280,7 +280,7 @@ def og_boot_symfony_install():
|
|||
shutil.copy(env_src, env_dest)
|
||||
shutil.copy(composer_src, composer_dest)
|
||||
logger.info(f"Copied environment source {env_src} to {env_dest}")
|
||||
logger.info(f"Copied composer source{composer_src} to {composer_dest}")
|
||||
logger.info(f"Copied composer source {composer_src} to {composer_dest}")
|
||||
|
||||
# Cambiar permisos y propietario de los archivos copiados
|
||||
os.chmod(env_dest, 0o644)
|
||||
|
@ -289,11 +289,18 @@ def og_boot_symfony_install():
|
|||
shutil.chown(composer_dest, user='ogboot', group='ogboot')
|
||||
logger.info(f"Set permissions and owner for {env_dest} and {composer_dest}")
|
||||
|
||||
logger.info(f".env and composer.json files copied to {INSTALL_OGBOOT_TARGET}")
|
||||
# Añadir la línea OGCORE_API_URL utilizando OGCORE_IP
|
||||
ogcore_api_url = f'OGCORE_API_URL="https://{OGCORE_IP}"'
|
||||
with open(env_dest, 'a') as env_file:
|
||||
env_file.write(f"\n{ogcore_api_url}\n")
|
||||
logger.info(f"Added OGCORE_API_URL to {env_dest} with IP: {OGCORE_IP}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"An error occurred while copying files: {e}")
|
||||
logger.error(f"An error occurred while copying files or modifying .env: {e}")
|
||||
raise
|
||||
|
||||
|
||||
|
||||
def og_boot_copy_files():
|
||||
global INSTALL_TARGET, WORKDIR
|
||||
bin_source = os.path.join(WORKDIR, "ogboot/bin")
|
||||
|
@ -873,7 +880,6 @@ logger.info(f":::::::::::::::::::::::: Starting ogBoot installation ::::::::::::
|
|||
|
||||
logger.info("environment variables")
|
||||
logger.info(f"OGCORE_IP:{OGCORE_IP}")
|
||||
logger.info(f"OGCORE_SERVER:{OGCORE_SERVER}")
|
||||
logger.info(f"INSTALL_TARGET:{INSTALL_TARGET}")
|
||||
logger.info(f"INSTALL_OGBOOT_TARGET:{INSTALL_OGBOOT_TARGET}")
|
||||
logger.info(f"INSTALL_OPENGNSYS_TARGET:{INSTALL_OPENGNSYS_TARGET}")
|
||||
|
|
Loading…
Reference in New Issue