diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7f5a40f..b80bc9b 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,5 +1,6 @@ version: "3.9" +# Application name (group name for the 4 images composing the PyROS app) name: pyros-app services: diff --git a/pyros.py b/pyros.py index b480b7e..bc5fedd 100755 --- a/pyros.py +++ b/pyros.py @@ -587,9 +587,7 @@ def _install_or_update(UPDATE: bool = False, with_packages: bool = True, with_da # if WITH_DOCKER: only install the DB (with_database = True) if WITH_DOCKER: with_packages = False - # if not with_packages and not with_database: with_packages = with_database = True - print("- with_packages:", with_packages) print("- with_database:", with_database) @@ -600,13 +598,14 @@ def _install_or_update(UPDATE: bool = False, with_packages: bool = True, with_da num = 0 if UPDATE: - # Update source code (git pull) + # 1) Update source code (git pull) num += 1 printFullTerm(Colors.BLUE, f"{num}) UPDATING SOURCE CODE: Running git pull") if not WITH_DOCKER: _gitpull() or die() if with_packages: + # 2) Install venv and packages in it # Update python packages (pip upgrade AND pip install requirements) num += 1 printFullTerm(Colors.BLUE, f"{num}) {ACTION} PYTHON PACKAGES") @@ -617,7 +616,7 @@ def _install_or_update(UPDATE: bool = False, with_packages: bool = True, with_da if UPDATE: print("Running UPDATE command") else: - # Install GitPython package for git support inside python + # 3) Install GitPython package for git support inside python print("Running INSTALL command") try: from git import Repo @@ -644,59 +643,58 @@ def _install_or_update(UPDATE: bool = False, with_packages: bool = True, with_da change_dir("PREVIOUS") ''' - # - # Guitastro - # - GUITASTRO_PATH = os.path.join(os.getcwd(), "./vendor/guitastro") - if with_packages: # and not WITH_DOCKER: - #GUITASTRO_PATH = os.path.join(os.getcwd(), "../vendor/guitastro") - change_dir("..") + # 4) Install GUITASTRO + its requirements + # (ONLY FOR NON DOCKER INSTALL) print(os.getcwd()) - # 1) clone repo if not yet done - if not WITH_DOCKER and not os.path.exists(GUITASTRO_PATH): - print("Guitastro : Cloning repository") - cloned_repo = Repo.clone_from( - "https://gitlab.irap.omp.eu/guitastrolib/guitastro.git", GUITASTRO_PATH) - print("Cloned successfully: ", cloned_repo.__class__ is Repo) - if UPDATE and os.path.exists(GUITASTRO_PATH) and and not WITH_DOCKER: - gitpull_guitastro() - change_dir("PREVIOUS") - # 2) install/update requirements & generate API doc - if not WITH_DOCKER and os.path.exists(GUITASTRO_PATH): - # TODO: update guitastro (git pull from vendor/guitastro/) - print("\nGuitastro : Installing/Updating python package dependencies\n") - # Upgrade pip if new version available - os.system(VENV_PYTHON + ' -m pip install --upgrade pip') - # TODO: faire les apt-get intall aussi (indi, ...) - venv_pip_install2(GUITASTRO_PATH + '/install/requirements.txt', '-r') - #venv_pip_install2(GUITASTRO_PATH + '/install/requirements_linux.txt', '-r') - venv_pip_install2(GUITASTRO_PATH + '/install/requirements_dev.txt', '-r') - ''' - print("Guitastro : Generating (updating) API documentation (using Sphinx)") - # Make html doc from RST - # cd doc/sourcedoc/ - change_dir(GUITASTRO_PATH + '/doc_rst/') - # ./MAKE_DOC.sh - res = execProcess('/bin/bash MAKE_DOC.sh') - # Come back to where we were before - # cd - - change_dir("PREVIOUS") - ''' - - - # 3) Update PlantUML diagrams + if not WITH_DOCKER: + GUITASTRO_PATH = os.path.join(os.getcwd(), "./vendor/guitastro") + if with_packages: + change_dir("..") + print(os.getcwd()) + if not os.path.exists(GUITASTRO_PATH): + # a) clone repo if not yet done + print("Guitastro : Cloning repository") + cloned_repo = Repo.clone_from( + "https://gitlab.irap.omp.eu/guitastrolib/guitastro.git", GUITASTRO_PATH) + print("Cloned successfully: ", cloned_repo.__class__ is Repo) + if os.path.exists(GUITASTRO_PATH): + if UPDATE: + gitpull_guitastro() + change_dir("PREVIOUS") + # b) install/update requirements & generate API doc + # TODO: update guitastro (git pull from vendor/guitastro/) + print("\nGuitastro : Installing/Updating python package dependencies\n") + # Upgrade pip if new version available + os.system(VENV_PYTHON + ' -m pip install --upgrade pip') + # TODO: faire les apt-get intall aussi (indi, ...) + venv_pip_install2(GUITASTRO_PATH + '/install/requirements.txt', '-r') + #venv_pip_install2(GUITASTRO_PATH + '/install/requirements_linux.txt', '-r') + venv_pip_install2(GUITASTRO_PATH + '/install/requirements_dev.txt', '-r') + ''' + print("Guitastro : Generating (updating) API documentation (using Sphinx)") + # Make html doc from RST + # cd doc/sourcedoc/ + change_dir(GUITASTRO_PATH + '/doc_rst/') + # ./MAKE_DOC.sh + res = execProcess('/bin/bash MAKE_DOC.sh') + # Come back to where we were before + # cd - + change_dir("PREVIOUS") + ''' + + # 5) Update PlantUML diagrams num += 1 printFullTerm(Colors.BLUE, f"{num}) UPDATING UML DIAGRAMS") _update_plantuml_diags() or die() print(os.getcwd()) - # 4) Update Sphinx API doc + # 6) Update Sphinx API doc (Non Windows only) num += 1 printFullTerm(Colors.BLUE, f"{num}) UPDATING API DOC (with Sphinx)") if not IS_WINDOWS: _update_api_doc() or die() - # 5) Install/Update database structure (make migrations + migrate) + # 7) Install/Update database structure (make migrations + migrate) if with_database: num += 1 printFullTerm(Colors.BLUE, f"{num}) {ACTION} DATABASE") -- libgit2 0.21.2