Commit 3a36c853f704d0b8fb492002d4e0368f7f33d352
1 parent
80d4ac71
Exists in
dev
"./pyros install -p -d"
(-p = --packages_only ; -d = --database_only)
Showing
3 changed files
with
34 additions
and
15 deletions
Show diff stats
README.md
... | ... | @@ -71,12 +71,10 @@ Date: 19/06/2019 |
71 | 71 | |
72 | 72 | Author: E. Pallier (epallier@irap.omp.eu) |
73 | 73 | |
74 | -VERSION: 0.30.11 | |
74 | +VERSION: 0.30.12 | |
75 | 75 | |
76 | 76 | Comment : |
77 | -- Bugfixed AgentM | |
78 | -- Named test database "test_pyros" explicitely | |
79 | -- Keep test database test_pyros (do not delete it after tests) | |
77 | +- "./pyros install -p -d" => (-p = packages_only ; -d = -database_only) | |
80 | 78 | |
81 | 79 | |
82 | 80 | RAPPELS SUR L'UTILISATION : |
... | ... | @@ -114,6 +112,13 @@ Full list of commits: https://gitlab.irap.omp.eu/epallier/pyros/commits/master |
114 | 112 | (The new official changes history is here : https://tinyurl.com/pyros-dev#heading=h.2r55bflctpt5) |
115 | 113 | |
116 | 114 | |
115 | +**19/06/2019 : v0.30.11 (EP)** | |
116 | + | |
117 | + - Bugfixed AgentM | |
118 | + - Named test database "test_pyros" explicitely | |
119 | + - Keep test database test_pyros (do not delete it after tests) | |
120 | + | |
121 | + | |
117 | 122 | **12/06-17/06/2019 : v0.30.3-9 (EP)** |
118 | 123 | |
119 | 124 | - Restructuration du projet - phase 1 : /src/ => /pyros_django/ | ... | ... |
install/install.py
... | ... | @@ -376,21 +376,28 @@ def install_database(venv): |
376 | 376 | |
377 | 377 | def _help(): |
378 | 378 | print( |
379 | - "Welcome in the installation script of the pyros venv.\t\nPlease launch it from the install directory of pyros.\n\tIf you're on Ubuntu Debian or CentOS:\n\tlaunch it with sudo and <--prerequisites> or <-p> to install the prerequisites.\n\t-->sudo ./test_install.py -p\n\n\tFor the python packages launch it from the install directory of pyros without sudo and without parameter\n\t-->./test_install.py") | |
380 | - | |
379 | + #"Welcome in the installation script of the pyros venv.\t\nPlease launch it from the install directory of pyros.\n\tIf you're on Ubuntu Debian or CentOS:\n\tlaunch it with sudo and <--prerequisites> or <-p> to install the prerequisites.\n\t-->sudo ./test_install.py -p\n\n\tFor the python packages launch it from the install directory of pyros without sudo and without parameter\n\t-->./test_install.py") | |
380 | + "Welcome to the installation script of the pyros software.\t\n" + \ | |
381 | + "Usage:\n" + \ | |
382 | + " [python] ./pyros.py install [-p] [-d]" | |
383 | + ) | |
381 | 384 | |
382 | 385 | |
383 | 386 | |
384 | 387 | |
385 | 388 | if __name__ == '__main__': |
386 | - if (len(sys.argv) > 1): | |
389 | + if len(sys.argv) > 2: _help() ; sys.exit(1) | |
390 | + #print(sys.argv) | |
391 | + if len(sys.argv) == 2: | |
392 | + INSTALL_VENV = INSTALL_DB = False | |
393 | + if sys.argv[1] == '-p': INSTALL_VENV=True | |
394 | + if sys.argv[1] == '-d': INSTALL_DB=True | |
395 | + ''' | |
396 | + # Prerequisistes installation (for CentOS) => not a good idea for now, deactivated (EP) | |
387 | 397 | if sys.argv[1] == "--prerequisites" or sys.argv[1] == "-p": |
388 | 398 | install_required() |
389 | 399 | else: |
390 | 400 | _help() |
391 | - elif len(sys.argv) == 1: | |
392 | - if INSTALL_VENV: install_venv(VENV) | |
393 | - if INSTALL_DB: install_database(VENV) | |
394 | - | |
395 | - else: | |
396 | - _help() | |
401 | + ''' | |
402 | + if INSTALL_VENV: install_venv(VENV) | |
403 | + if INSTALL_DB: install_database(VENV) | ... | ... |
pyros.py
... | ... | @@ -288,16 +288,23 @@ def dbshell(): |
288 | 288 | |
289 | 289 | |
290 | 290 | @pyros_launcher.command(help="Install the pyros software") |
291 | +@click.option('--packages_only', '-p', is_flag=True, help='install only the python packages (no database installation)') | |
292 | +@click.option('--database_only', '-d', is_flag=True, help='install only the pyros database (no python packages installation)') | |
291 | 293 | #@global_test_options |
292 | -def install(): | |
294 | +def install(packages_only, database_only): | |
293 | 295 | print("Running install command") |
296 | + print("packages_only", packages_only) | |
297 | + print("database_only", database_only) | |
294 | 298 | #if test_mode(): print("in test mode") |
295 | 299 | # self.execProcess("python3 install/install.py install") |
296 | 300 | # if (os.path.basename(os.getcwd()) != "private"): |
297 | 301 | start_dir = os.getcwd() |
298 | 302 | os.chdir("install/") ; _in_dir("install") or die("Bad dir") |
299 | 303 | # execProcess("python install.py install") |
300 | - if not test_mode(): execProcess(PYTHON + " install.py") | |
304 | + option='' | |
305 | + if packages_only: option='-p' | |
306 | + if database_only: option='-d' | |
307 | + test_mode() or execProcess(PYTHON + " install.py " + option) | |
301 | 308 | # cd - |
302 | 309 | # os.chdir("-") |
303 | 310 | os.chdir(start_dir) ; _in_abs_dir(start_dir) or die("Bad dir") | ... | ... |