Init app_shell

This commit is contained in:
tituspijean 2023-05-03 19:59:28 +00:00
parent 06826b4fc0
commit 3bb32dc1e4
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 26 additions and 0 deletions

View file

@ -954,6 +954,12 @@ app:
help: Delete the key help: Delete the key
action: store_true action: store_true
### app_shell()
shell:
action_help: Open an interactive shell with the app environment already loaded
arguments:
app:
help: App ID
### app_register_url() ### app_register_url()
register-url: register-url:

View file

@ -1645,6 +1645,26 @@ def app_setting(app, key, value=None, delete=False):
_set_app_settings(app, app_settings) _set_app_settings(app, app_settings)
def app_shell(app):
"""
Open an interactive shell with the app environment already loaded
Keyword argument:
app -- App ID
"""
app_settings = _get_app_settings(app) or {}
#TODO init a env_dict
#TODO load the app's environment, parsed from:
#TODO - its settings (phpversion, ...)
#TODO - its service configuration (PATH, NodeJS production mode...)
#TODO this one could be performed in Bash, directly after initiating the subprocess:
#TODO - "Environment" clause: `systemctl show $app.service -p "Environment" --value`
#TODO - Source "EnvironmentFile" clauses
#TODO
#TODO find out how to open an interactive Bash shell from Python
def app_register_url(app, domain, path): def app_register_url(app, domain, path):
""" """
Book/register a web path for a given app Book/register a web path for a given app