[ADD] todo: add deploy menu with git clone
Allow users to deploy ERPLibre to a local directory via git clone from the TODO interactive menu, making onboarding simpler for new developers. Generated by Claude Code 2.1.74 model claude-opus-4-6 Co-Authored-By: Mathieu Benoit <mathben@technolibre.ca>
This commit is contained in:
parent
4fc15c306b
commit
bee6d50018
2 changed files with 93 additions and 0 deletions
|
|
@ -208,6 +208,7 @@ class TODO:
|
||||||
[12] {t("Security - Dependency security audit")}
|
[12] {t("Security - Dependency security audit")}
|
||||||
[13] {t("Test - Test an Odoo module")}
|
[13] {t("Test - Test an Odoo module")}
|
||||||
[14] {t("Update - Update all developed staging source code")}
|
[14] {t("Update - Update all developed staging source code")}
|
||||||
|
[15] {t("Deploy - Deploy ERPLibre locally")}
|
||||||
[0] {t("Back")}
|
[0] {t("Back")}
|
||||||
"""
|
"""
|
||||||
while True:
|
while True:
|
||||||
|
|
@ -271,6 +272,10 @@ class TODO:
|
||||||
status = self.prompt_execute_update()
|
status = self.prompt_execute_update()
|
||||||
if status is not False:
|
if status is not False:
|
||||||
return
|
return
|
||||||
|
elif status == "15":
|
||||||
|
status = self.prompt_execute_deploy()
|
||||||
|
if status is not False:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
print(t("Command not found !"))
|
print(t("Command not found !"))
|
||||||
|
|
||||||
|
|
@ -606,6 +611,61 @@ class TODO:
|
||||||
if cmd_no_found:
|
if cmd_no_found:
|
||||||
print(t("Command not found !"))
|
print(t("Command not found !"))
|
||||||
|
|
||||||
|
def prompt_execute_deploy(self):
|
||||||
|
print(
|
||||||
|
f"🤖 {t('Deploy ERPLibre to a local directory!')}"
|
||||||
|
)
|
||||||
|
choices = [
|
||||||
|
{
|
||||||
|
"prompt_description": t(
|
||||||
|
"Clone ERPLibre locally (git clone)"
|
||||||
|
)
|
||||||
|
},
|
||||||
|
]
|
||||||
|
help_info = self.fill_help_info(choices)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
status = click.prompt(help_info)
|
||||||
|
print()
|
||||||
|
if status == "0":
|
||||||
|
return False
|
||||||
|
elif status == "1":
|
||||||
|
self._deploy_clone_erplibre()
|
||||||
|
else:
|
||||||
|
print(t("Command not found !"))
|
||||||
|
|
||||||
|
def _deploy_clone_erplibre(self):
|
||||||
|
default_path = os.path.expanduser("~/erplibre")
|
||||||
|
target_path = (
|
||||||
|
input(
|
||||||
|
t("Target directory path (default: ~/erplibre): ")
|
||||||
|
).strip()
|
||||||
|
or default_path
|
||||||
|
)
|
||||||
|
target_path = os.path.expanduser(target_path)
|
||||||
|
if os.path.exists(target_path):
|
||||||
|
print(
|
||||||
|
f"{t('Directory already exists: ')}{target_path}"
|
||||||
|
)
|
||||||
|
return
|
||||||
|
print(t("Cloning ERPLibre..."))
|
||||||
|
cmd = (
|
||||||
|
"git clone"
|
||||||
|
" https://github.com/erplibre/erplibre"
|
||||||
|
f" {target_path}"
|
||||||
|
)
|
||||||
|
print(f"{t('Will execute:')} {cmd}")
|
||||||
|
try:
|
||||||
|
self.execute.exec_command_live(
|
||||||
|
cmd, source_erplibre=False
|
||||||
|
)
|
||||||
|
print(
|
||||||
|
f"{t('ERPLibre cloned successfully to: ')}"
|
||||||
|
f"{target_path}"
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
print(f"{t('Error cloning ERPLibre: ')}{e}")
|
||||||
|
|
||||||
def prompt_execute_code(self):
|
def prompt_execute_code(self):
|
||||||
print(f"🤖 {t('What do you need for development?')}")
|
print(f"🤖 {t('What do you need for development?')}")
|
||||||
# help_info = """Commande :
|
# help_info = """Commande :
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,39 @@ TRANSLATIONS = {
|
||||||
"fr": "Langue - Changer la langue / Change language",
|
"fr": "Langue - Changer la langue / Change language",
|
||||||
"en": "Language - Change language / Changer la langue",
|
"en": "Language - Change language / Changer la langue",
|
||||||
},
|
},
|
||||||
|
# Deploy section
|
||||||
|
"Deploy - Deploy ERPLibre locally": {
|
||||||
|
"fr": "Déploiement - Déployer ERPLibre localement",
|
||||||
|
"en": "Deploy - Deploy ERPLibre locally",
|
||||||
|
},
|
||||||
|
"Deploy ERPLibre to a local directory!": {
|
||||||
|
"fr": "Déployer ERPLibre dans un répertoire local!",
|
||||||
|
"en": "Deploy ERPLibre to a local directory!",
|
||||||
|
},
|
||||||
|
"Clone ERPLibre locally (git clone)": {
|
||||||
|
"fr": "Cloner ERPLibre localement (git clone)",
|
||||||
|
"en": "Clone ERPLibre locally (git clone)",
|
||||||
|
},
|
||||||
|
"Target directory path (default: ~/erplibre): ": {
|
||||||
|
"fr": "Chemin du répertoire cible (défaut: ~/erplibre) : ",
|
||||||
|
"en": "Target directory path (default: ~/erplibre): ",
|
||||||
|
},
|
||||||
|
"Directory already exists: ": {
|
||||||
|
"fr": "Le répertoire existe déjà : ",
|
||||||
|
"en": "Directory already exists: ",
|
||||||
|
},
|
||||||
|
"Cloning ERPLibre...": {
|
||||||
|
"fr": "Clonage d'ERPLibre en cours...",
|
||||||
|
"en": "Cloning ERPLibre...",
|
||||||
|
},
|
||||||
|
"ERPLibre cloned successfully to: ": {
|
||||||
|
"fr": "ERPLibre cloné avec succès dans : ",
|
||||||
|
"en": "ERPLibre cloned successfully to: ",
|
||||||
|
},
|
||||||
|
"Error cloning ERPLibre: ": {
|
||||||
|
"fr": "Erreur lors du clonage d'ERPLibre : ",
|
||||||
|
"en": "Error cloning ERPLibre: ",
|
||||||
|
},
|
||||||
# RTK (Rust Token Killer)
|
# RTK (Rust Token Killer)
|
||||||
"Manage RTK (Rust Token Killer) for token optimization!": {
|
"Manage RTK (Rust Token Killer) for token optimization!": {
|
||||||
"fr": "Gérer RTK (Rust Token Killer) pour optimiser les tokens!",
|
"fr": "Gérer RTK (Rust Token Killer) pour optimiser les tokens!",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue