diff --git a/.gitignore b/.gitignore
index 04d387e..0904e0f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,7 @@ venv
config.conf
*.DS_Store
*.pyc
+
+.repo
+addons
+odoo
\ No newline at end of file
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index e69de29..0000000
diff --git a/default.dev.xml b/default.dev.xml
deleted file mode 100644
index 467426a..0000000
--- a/default.dev.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/default.xml b/default.xml
deleted file mode 100644
index 35622d3..0000000
--- a/default.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/env_var.sh b/env_var.sh
index b7a945b..d919be9 100755
--- a/env_var.sh
+++ b/env_var.sh
@@ -1,30 +1,23 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-################################################################################
+#!/usr/bin/env bash
-OE_USER="odoo"
-OE_HOME="/${OE_USER}"
-OE_HOME_ODOO="${OE_HOME}/odoo"
-OE_HOME_EXT="${OE_HOME_ODOO}/odoo"
+EL_USER="erplibre"
+EL_HOME="/${EL_USER}"
+EL_HOME_ERPLIBRE="${EL_HOME}/erplibre"
+EL_HOME_ODOO="${EL_HOME_ERPLIBRE}/odoo"
# The default port where this Odoo instance will run under (provided you use the command -c in the terminal)
# Set to true if you want to install it, false if you don't need it or have it already installed.
-INSTALL_WKHTMLTOPDF="True"
-# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
-OE_PORT="8069"
-OE_LONGPOLLING_PORT="8072"
+EL_INSTALL_WKHTMLTOPDF="True"
+# Set the default Odoo port
+EL_PORT="8069"
+EL_LONGPOLLING_PORT="8072"
# set the superadmin password
-OE_SUPERADMIN="admin"
-OE_VERSION="stable_prod_12.0"
-OE_CONFIG="${OE_USER}"
-MINIMAL_ADDONS="False"
+EL_SUPERADMIN="admin"
+EL_CONFIG="${EL_USER}"
+EL_MINIMAL_ADDONS="False"
# Set this to True if you want to install Nginx!
-INSTALL_NGINX="True"
+EL_INSTALL_NGINX="True"
# Set the website name
-WEBSITE_NAME="_"
-GITHUB_TOKEN=""
+EL_WEBSITE_NAME="_"
+EL_GITHUB_TOKEN=""
+EL_MANIFEST_PROD="./manifest/default.xml"
+EL_MANIFEST_DEV="./manifest/default.dev.xml"
diff --git a/manifest/default.dev.xml b/manifest/default.dev.xml
new file mode 100644
index 0000000..51c95b1
--- /dev/null
+++ b/manifest/default.dev.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/manifest/default.xml b/manifest/default.xml
new file mode 100644
index 0000000..bc968b9
--- /dev/null
+++ b/manifest/default.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/requirements.txt b/requirements.txt
index ca82ce2..124164f 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,4 +2,5 @@ giturlparse
agithub
gitpython
PyYAML
-retrying
\ No newline at end of file
+retrying
+xmltodict
\ No newline at end of file
diff --git a/run.sh b/run.sh
index 58f64fd..28b1df3 100755
--- a/run.sh
+++ b/run.sh
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
-./venv/bin/python ./odoo/odoo-bin -c ./config.conf
+./venv/bin/python ./odoo/odoo-bin -c ./config.conf $@
diff --git a/script/addons_repo_origin.py b/script/addons_repo_origin.py
deleted file mode 100644
index 1112471..0000000
--- a/script/addons_repo_origin.py
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/env python
-# dict config contains information about repository of original source
-# level 1: website of git
-# level 2: entity, organization, user
-# level 3: project name
-config = {
- "github.com": {
- "odoo": [
- "odoo",
- ],
- }
-}
-config_addons = {
- "github.com": {
- "MathBenTech": [
- "development",
- "odoo-business-spending-management-quebec-canada",
- "scrummer",
- ],
- "muk-it": [
- "muk_base",
- "muk_dms",
- "muk_docs",
- "muk_misc",
- "muk_quality",
- "muk_web",
- "muk_website",
- ],
- "Numigi": [
- "odoo-base-addons",
- "odoo-entertainment-addons",
- "odoo-git-addons",
- "odoo-hr-addons",
- "odoo-partner-addons",
- "odoo-product-addons",
- "odoo-project-addons",
- "odoo-purchase-addons",
- "odoo-stock-addons",
- "odoo-survey-addons",
- "odoo-timesheet-addons",
- "odoo-web-addons",
- ],
- "OCA": [
- "account-analytic",
- "account-budgeting",
- "account-closing",
- "account-consolidation",
- "account-financial-reporting",
- "account-fiscal-rule",
- "account-invoicing",
- "account-invoice-reporting",
- "account-payment",
- "account-reconcile",
- "apps-store",
- "bank-payment",
- "bank-statement-import",
- "brand",
- "business-requirement",
- "commission",
- "community-data-files",
- "connector-telephony",
- "contract",
- "credit-control",
- "currency",
- "data-protection",
- "donation",
- "e-commerce",
- "edi",
- "event",
- "helpdesk",
- "hr",
- "knowledge",
- "l10n-canada",
- "maintenance",
- "management-system",
- "manufacture",
- "margin-analysis",
- "mis-builder",
- "multi-company",
- "partner-contact",
- "pos",
- "product-attribute",
- "product-pack",
- "product-variant",
- "project",
- "project-reporting",
- "purchase-workflow",
- "queue",
- "reporting-engine",
- "sale-workflow",
- "server-auth",
- "server-brand",
- "server-env",
- "server-tools",
- "server-ux",
- "social",
- "stock-logistics-warehouse",
- "timesheet",
- "web",
- "website",
- "wms",
- ],
- "odooaktiv": [
- "QuotationRevision",
- ],
- "openeducat": [
- "openeducat_erp",
- ],
- "Smile-SA": [
- "odoo_addons",
- ],
- }
-}
diff --git a/script/fork_github_repo/__init__.py b/script/fork_github_repo/__init__.py
index fd213f4..1d7d081 100644
--- a/script/fork_github_repo/__init__.py
+++ b/script/fork_github_repo/__init__.py
@@ -147,7 +147,7 @@ def fork_and_clone_repo(
print("Error when forking repo %s" % forked_repo)
exit(1)
else:
- print("Forked %s to %s" % (upstream_url, forked_repo['ssh_url']))
+ print("Forked %s to %s" % (upstream_url, forked_repo['html_url']))
elif status == 202:
print("Forked repo %s already exists" % forked_repo['full_name'])
elif status != 200:
diff --git a/script/fork_project.py b/script/fork_project.py
index ce9a958..c2396a7 100644
--- a/script/fork_project.py
+++ b/script/fork_project.py
@@ -13,7 +13,7 @@ from script import fork_github_repo
from script.git_tool import GitTool
_logger = logging.getLogger(__name__)
-CST_GITHUB_TOKEN = "GITHUB_TOKEN"
+CST_EL_GITHUB_TOKEN = "EL_GITHUB_TOKEN"
def get_config():
@@ -37,7 +37,7 @@ def get_config():
parser.add_argument('--organization', dest="organization", default="ERPLibre",
help="Choose organization to fork and change all repo.")
parser.add_argument('--github_token', dest="github_token",
- default=config.get(CST_GITHUB_TOKEN),
+ default=config.get(CST_EL_GITHUB_TOKEN),
help="GitHub token generated by user")
args = parser.parse_args()
return args
@@ -50,7 +50,6 @@ def main():
if not github_token:
raise ValueError("Missing github_token")
repo_root = Repo(config.dir)
-
lst_repo = GitTool().get_source_repo_addons(repo_path=config.dir)
i = 0
total = len(lst_repo)
@@ -115,7 +114,7 @@ def main():
# Update origin to new repo
- GitTool().generate_odoo_install_locally()
+ GitTool().generate_install_locally()
if __name__ == '__main__':
diff --git a/script/fork_project_ERPLibre.py b/script/fork_project_ERPLibre.py
index 4917946..fb25b19 100644
--- a/script/fork_project_ERPLibre.py
+++ b/script/fork_project_ERPLibre.py
@@ -12,7 +12,7 @@ sys.path.append(new_path)
from script.git_tool import GitTool
_logger = logging.getLogger(__name__)
-CST_GITHUB_TOKEN = "GITHUB_TOKEN"
+CST_EL_GITHUB_TOKEN = "EL_GITHUB_TOKEN"
def get_config():
@@ -36,12 +36,11 @@ def get_config():
parser.add_argument('--organization', dest="organization", default="ERPLibre",
help="Choose organization to fork and change all repo.")
parser.add_argument("--skip_fork", action="store_true",
- help="Ignore fork to generate only dependancies like "
- ".gitmodules and odoo_install_locally.sh")
+ help="Ignore fork to generate only manifest.")
parser.add_argument('-f', "--force", action="store_true",
help="Force rewrite remote.")
parser.add_argument('--github_token', dest="github_token",
- default=config.get(CST_GITHUB_TOKEN),
+ default=config.get(CST_EL_GITHUB_TOKEN),
help="GitHub token generated by user")
args = parser.parse_args()
return args
@@ -53,79 +52,83 @@ def main():
git_tool = GitTool()
root_repo = Repo(config.dir)
- if not github_token:
+ if not github_token and not config.skip_fork:
raise ValueError("Missing github_token")
organization_name = config.organization
lst_repo = git_tool.get_source_repo_addons(repo_path=config.dir, add_repo_root=True)
lst_repo_organization = [git_tool.get_transformed_repo_info_from_url(
a.get("url"), repo_path=config.dir, organization_force=organization_name,
- is_submodule=a.get("is_submodule"), sub_path=a.get("sub_path"))
+ is_submodule=a.get("is_submodule"), sub_path=a.get("sub_path"),
+ revision=a.get("revision"), clone_depth=a.get("clone_depth"))
for a in lst_repo]
- i = 0
- total = len(lst_repo)
- for repo in lst_repo:
- i += 1
- print(f"Nb element {i}/{total}")
- url = repo.get("url")
- try:
- working_repo = Repo(repo.get("relative_path"))
- except git.exc.NoSuchPathError:
- # Check to fork
- # repo_info = git_tool.get_transformed_repo_info_from_url(
- # url, organization_force="ERPLibre",
- # is_submodule=repo.get("is_submodule"),
- # sub_path=repo.get("sub_path"))
- git_tool.fork_repo(upstream_url=url,
- github_token=github_token,
- organization_name="ERPLibre")
- repo_info = git_tool.get_transformed_repo_info_from_url(
- url, organization_force=organization_name,
- is_submodule=repo.get("is_submodule"), sub_path=repo.get("sub_path"))
- git_tool.fork_repo(upstream_url=url,
- github_token=github_token,
- organization_name=organization_name)
+ if not config.skip_fork:
+ i = 0
+ total = len(lst_repo)
+ for repo in lst_repo:
+ i += 1
+ print(f"Nb element {i}/{total} - {repo.get('project_name')}")
+ url = repo.get("url")
- git_tool.add_and_fetch_remote(repo_info, root_repo=root_repo)
- continue
+ try:
+ working_repo = Repo(repo.get("relative_path"))
+ except git.exc.NoSuchPathError:
+ # Check to fork
+ # repo_info = git_tool.get_transformed_repo_info_from_url(
+ # url, organization_force="ERPLibre",
+ # is_submodule=repo.get("is_submodule"),
+ # sub_path=repo.get("sub_path"))
+ git_tool.fork_repo(upstream_url=url,
+ github_token=github_token,
+ organization_name="ERPLibre")
+ repo_info = git_tool.get_transformed_repo_info_from_url(
+ url, organization_force=organization_name,
+ is_submodule=repo.get("is_submodule"),
+ sub_path=repo.get("sub_path"))
+ git_tool.fork_repo(upstream_url=url,
+ github_token=github_token,
+ organization_name=organization_name)
- dct_remote_name = {a.name: a for a in working_repo.remotes}
- remote_origin = dct_remote_name.get("origin")
- remote_erplibre = dct_remote_name.get("ERPLibre")
- remote_organization = dct_remote_name.get(organization_name)
+ # git_tool.add_and_fetch_remote(repo_info, root_repo=root_repo)
+ continue
+
+ dct_remote_name = {a.name: a for a in working_repo.remotes}
+ remote_origin = dct_remote_name.get("origin")
+ remote_erplibre = dct_remote_name.get("ERPLibre")
+ remote_organization = dct_remote_name.get(organization_name)
- if not config.skip_fork:
if not remote_erplibre:
repo_info = git_tool.get_transformed_repo_info_from_url(
url, organization_force="ERPLibre",
is_submodule=repo.get("is_submodule"),
sub_path=repo.get("sub_path"))
- git_tool.add_and_fetch_remote(repo_info)
+ # git_tool.add_and_fetch_remote(repo_info)
git_tool.fork_repo(url, github_token,
organization_name=organization_name,
)
- repo_info = git_tool.get_transformed_repo_info_from_url(
- url, organization_force=organization_name,
- is_submodule=repo.get("is_submodule"), sub_path=repo.get("sub_path"))
- if remote_origin:
- working_repo.git.remote("remove", "origin")
- repo_info.organization = "origin"
- try:
- git_tool.add_and_fetch_remote(repo_info, root_repo=root_repo)
- except Exception as e:
- print(e)
- if config.force and remote_organization:
- working_repo.git.remote("remove", organization_name)
+ repo_info = git_tool.get_transformed_repo_info_from_url(
+ url, organization_force=organization_name,
+ is_submodule=repo.get("is_submodule"), sub_path=repo.get("sub_path"))
+ if remote_origin:
+ working_repo.git.remote("remove", "origin")
+ repo_info.organization = "origin"
+ # try:
+ # git_tool.add_and_fetch_remote(repo_info, root_repo=root_repo)
+ # except Exception as e:
+ # print(e)
+ if config.force and remote_organization:
+ working_repo.git.remote("remove", organization_name)
- repo_info.organization = organization_name
- git_tool.add_and_fetch_remote(repo_info)
+ repo_info.organization = organization_name
+ # git_tool.add_and_fetch_remote(repo_info)
# Update origin to new repo
- git_tool.generate_git_modules(lst_repo_organization, repo_path=config.dir)
- git_tool.generate_odoo_install_locally()
+ # git_tool.generate_git_modules(lst_repo_organization, repo_path=config.dir)
+ git_tool.generate_repo_manifest(lst_repo_organization, repo_path=config.dir)
+ git_tool.generate_install_locally()
if __name__ == '__main__':
diff --git a/script/git_change_remote.py b/script/git_change_remote.py
index 4679d96..91b1282 100755
--- a/script/git_change_remote.py
+++ b/script/git_change_remote.py
@@ -10,11 +10,10 @@ from retrying import retry # pip install retrying
new_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(new_path)
-from script import fork_github_repo
from script import git_tool
_logger = logging.getLogger(__name__)
-CST_GITHUB_TOKEN = "GITHUB_TOKEN"
+CST_EL_GITHUB_TOKEN = "EL_GITHUB_TOKEN"
def get_config():
@@ -36,18 +35,20 @@ def get_config():
parser.add_argument('-d', '--dir', dest="dir", default="./",
help="Path of repo to change remote, including submodule.")
parser.add_argument('--github_token', dest="github_token",
- default=config.get(CST_GITHUB_TOKEN),
+ default=config.get(CST_EL_GITHUB_TOKEN),
help="GitHub token generated by user")
parser.add_argument("--open_web_browser", action="store_true",
help="Open web browser for each repo.")
parser.add_argument("--generate_only_install_locally", action="store_true",
- help="Only generate script odoo_install_locally.sh.")
- parser.add_argument("--generate_repo_source_from_building", action="store_true",
- help=f"Only generate "
- f"{git_tool.CST_FILE_SOURCE_REPO_ADDONS_ODOO}")
+ help="Only generate script install_locally.sh.")
parser.add_argument("--sync_to", dest="sync_to",
- help=f"Only synchronize matching repo, use path compare to "
- f"repo.")
+ help="Only synchronize matching repo, use path compare to "
+ "repo.")
+ parser.add_argument("--dry_sync", dest="dry_sync", action="store_true",
+ help="Don't apply modification when sync_to.")
+ parser.add_argument("--sync_with_submodule", dest="sync_with_submodule",
+ action="store_true",
+ help="Remote directory use submodule to sync.")
args = parser.parse_args()
return args
@@ -58,24 +59,23 @@ def main():
config = get_config()
if config.generate_only_install_locally:
+ print("Generate config file locally.")
gt = git_tool.GitTool()
- gt.generate_odoo_install_locally()
- return
-
- if config.generate_repo_source_from_building:
- gt = git_tool.GitTool()
- gt.generate_repo_source_from_building()
+ gt.generate_install_locally()
return
if config.sync_to:
+ if config.sync_to[-1] != "/":
+ config.sync_to += "/"
gt = git_tool.GitTool()
result = gt.get_matching_repo(repo_compare_to=config.sync_to,
- force_normalize_compare=True)
- gt.sync_to(result)
+ force_normalize_compare=True,
+ sync_with_submodule=config.sync_with_submodule)
+ gt.sync_to(result, checkout_when_diff=not config.dry_sync)
return
# repo_root = Repo(".")
- lst_repo = git_tool.GitTool.get_repo_info_submodule(repo_path=config.dir)
+ lst_repo = git_tool.GitTool.get_repo_info(repo_path=config.dir)
i = 0
total = len(lst_repo)
for repo in lst_repo:
diff --git a/script/git_change_remote_https_to_git.py b/script/git_change_remote_https_to_git.py
index 5b055bb..ebdbeec 100755
--- a/script/git_change_remote_https_to_git.py
+++ b/script/git_change_remote_https_to_git.py
@@ -34,11 +34,9 @@ def get_config():
)
parser.add_argument('-d', '--dir', dest="dir", default="./",
help="Path of repo to change remote, including submodule.")
- parser.add_argument('-f', '--upstream', dest="upstream", default="origin",
- help="Upstream name to change address https to git.")
- # TODO support all_upstream
- # parser.add_argument("--all_upstream", action="store_true",
- # help="Replace for all existing upstream for each repo.")
+ parser.add_argument('-f', '--upstream', dest="upstream",
+ help="Upstream name to change address https to git. "
+ "When empty, all upstream is updated.")
parser.add_argument("--git_to_https", action="store_true",
help="Replace all repo git to https.")
args = parser.parse_args()
@@ -50,20 +48,24 @@ def main():
config = get_config()
upstream_name = config.upstream
- lst_repo = git_tool.get_repo_info_submodule(config.dir, add_root=True,
- upstream=upstream_name)
+ lst_repo = git_tool.get_repo_info(config.dir, add_root=True)
i = 0
total = len(lst_repo)
for repo in lst_repo:
i += 1
print(f"Nb element {i}/{total}")
repo_sm = Repo(repo.get("name"))
- remote_upstream_name = [a for a in repo_sm.remotes if upstream_name == a.name]
- new_url = repo.get("url_https") if config.git_to_https else repo.get("url_git")
+ if upstream_name:
+ remote_upstream_name = [a for a in repo_sm.remotes
+ if upstream_name == a.name]
+ else:
+ remote_upstream_name = [a for a in repo_sm.remotes]
for remote in remote_upstream_name:
+ url, url_https, url_git = git_tool.get_url(remote.url)
+ new_url = url_https if config.git_to_https else url_git
remote.set_url(new_url)
- print('Remote "%s" created for %s' % (upstream_name, new_url))
+ print(f'Remote "{remote.name}" update for {new_url}')
if __name__ == '__main__':
diff --git a/script/git_repo_manifest.py b/script/git_repo_manifest.py
new file mode 100644
index 0000000..e2b634a
--- /dev/null
+++ b/script/git_repo_manifest.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+import os
+import sys
+import argparse
+import logging
+
+new_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
+sys.path.append(new_path)
+
+from script.git_tool import GitTool
+
+_logger = logging.getLogger(__name__)
+
+
+def get_config():
+ """Parse command line arguments, extracting the config file name,
+ returning the union of config file and command line arguments
+
+ :return: dict of config file settings and command line arguments
+ """
+ # TODO update description
+ parser = argparse.ArgumentParser(
+ formatter_class=argparse.RawDescriptionHelpFormatter,
+ description='''\
+''',
+ epilog='''\
+'''
+ )
+ parser.add_argument('-d', '--dir', dest="dir", default="./",
+ help="Path of repo to change remote, including submodule.")
+ parser.add_argument('--clear', action="store_true",
+ help="Create a new manifest and clear old configuration.")
+ args = parser.parse_args()
+ return args
+
+
+def main():
+ config = get_config()
+ git_tool = GitTool()
+
+ lst_repo = git_tool.get_source_repo_addons(repo_path=config.dir, add_repo_root=True)
+ lst_repo_organization = [git_tool.get_transformed_repo_info_from_url(
+ a.get("url"), repo_path=config.dir, get_obj=True,
+ is_submodule=a.get("is_submodule"), sub_path=a.get("sub_path"),
+ revision=a.get("revision"), clone_depth=a.get("clone_depth"))
+ for a in lst_repo]
+
+ # Update origin to new repo
+ if not config.clear:
+ dct_remote, dct_project = git_tool.get_manifest_xml_info(repo_path=config.dir,
+ add_root=True)
+ else:
+ dct_remote = {}
+ dct_project = {}
+ git_tool.generate_repo_manifest(lst_repo_organization, repo_path=config.dir,
+ dct_remote=dct_remote, dct_project=dct_project)
+ git_tool.generate_install_locally()
+
+
+if __name__ == '__main__':
+ main()
diff --git a/script/git_tool.py b/script/git_tool.py
index e8d647f..8bec5d2 100644
--- a/script/git_tool.py
+++ b/script/git_tool.py
@@ -2,18 +2,19 @@
# © 2020 TechnoLibre (http://www.technolibre.ca)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import os
-from . import addons_repo_origin
import webbrowser
from retrying import retry # pip install retrying
from agithub.GitHub import GitHub # pip install agithub
from giturlparse import parse # pip install giturlparse
+import xmltodict
+from collections import OrderedDict
from git import Repo
import git
from typing import List
-CST_FILE_SOURCE_REPO_ADDONS_ODOO = "source_repo_addons_odoo.csv"
-CST_GITHUB_TOKEN = "GITHUB_TOKEN"
+CST_FILE_SOURCE_REPO_ADDONS = "source_repo_addons.csv"
+CST_EL_GITHUB_TOKEN = "EL_GITHUB_TOKEN"
class Struct(object):
@@ -42,15 +43,20 @@ class GitTool:
get_obj: bool = True,
is_submodule: bool = True,
organization_force: str = None,
- sub_path: str = "addons") -> object:
+ sub_path: str = "addons",
+ revision: str = "",
+ clone_depth: str = "") -> object:
"""
:param url:
:param repo_path:
:param get_obj:
:param is_submodule:
- :param path:
:param organization_force: Keep repo_path and change organization
+ :param sub_path:
+ :param revision: Tag or branch name. When empty, use default branch.
+ :param clone_depth: length of git history to clone. Clone all git when empty.
+ Set to 0 to increase speed to clone, set to empty for development.
:return:
"""
_, url_https, url_git = self.get_url(url)
@@ -72,18 +78,30 @@ class GitTool:
relative_path = f"{repo_path}/{path}"
relative_path = os.path.normpath(relative_path)
+ original_organization = organization
+ url_https_original_organization = url_https[:url_https.rfind("/")]
+ project_name = url_https[url_https.rfind("/") + 1:]
+ # begin_original = url_git[url_git.find(":") + 1:]
+ # original_organization = begin_original[:begin_original.find("/")]
if organization_force:
organization = organization_force
url_split = url_https.split("/")
url_split[3] = organization
url_https = "/".join(url_split)
url, _, url_git = self.get_url(url_https)
+ url_https_organization = url_https[:url_https.rfind("/")]
d = {
"url": url,
"url_git": url_git,
"url_https": url_https,
"organization": organization,
+ "original_organization": original_organization,
+ "url_https_organization": url_https_organization,
+ "url_https_original_organization": url_https_original_organization,
+ "project_name": project_name,
+ "revision": revision,
+ "clone_depth": clone_depth,
"repo_name": repo_name,
"path": path,
"relative_path": relative_path,
@@ -94,9 +112,15 @@ class GitTool:
return Struct(**d)
return d
- @staticmethod
- def get_repo_info_submodule(repo_path: str = "./", add_root: bool = False,
- upstream: str = "origin") -> list:
+ def get_repo_info(self, repo_path: str = "./",
+ add_root: bool = False, is_manifest: bool = True):
+ if is_manifest:
+ return self.get_repo_info_manifest_xml(repo_path=repo_path,
+ add_root=add_root)
+ return self.get_repo_info_submodule(repo_path=repo_path, add_root=add_root)
+
+ def get_repo_info_submodule(self, repo_path: str = "./",
+ add_root: bool = False) -> list:
"""
Get information about submodule from repo_path
:param repo_path: path of repo to get information about submodule
@@ -139,12 +163,7 @@ class GitTool:
continue
elif line[:7] == "\turl = ":
url = line[7:-1]
- if "https" in url:
- url_git = f"git@{url[8:].replace('/', ':', 1)}"
- url_https = url
- else:
- url_https = f"https://{(url[4:]).replace(':', '/')}"
- url_git = url
+ url, url_https, url_git = self.get_url(url)
continue
elif line[:8] == "\tpath = ":
path = line[8:-1]
@@ -168,12 +187,7 @@ class GitTool:
if add_root:
repo_root = Repo(repo_path)
url = repo_root.git.remote("get-url", "origin")
- if "https" in url:
- url_git = f"git@{url[8:].replace('/', ':', 1)}"
- url_https = url
- else:
- url_https = f"https://{(url[4:]).replace(':', '/')}"
- url_git = url
+ url, url_https, url_git = self.get_url(url)
data = {
"url": url,
@@ -187,10 +201,12 @@ class GitTool:
lst_repo = sorted(lst_repo, key=lambda k: k.get("name"))
return lst_repo
- @staticmethod
- def get_repo_info_from_data_structure(repo_path="./", ignore_odoo=False):
+ def get_repo_info_manifest_xml(self, repo_path: str = "./",
+ add_root: bool = False) -> list:
"""
- Deprecated, read file addons_repo_origin to obtains repo list.
+ Get information about manifest of Repo from repo_path
+ :param repo_path: path of repo to get information about submodule
+ :param add_root: add information about root repository
:return:
[{
"url": original_url,
@@ -201,36 +217,79 @@ class GitTool:
"name": name of the submodule
}]
"""
- dct_config = {
- "addons": addons_repo_origin.config_addons
- }
- if not ignore_odoo:
- dct_config[""] = addons_repo_origin.config
- result = []
- for c_path, dct_config in dct_config.items():
- for server, dct_organization in dct_config.items():
- for organization, lst_repo in dct_organization.items():
- for repo in lst_repo:
- url = f"https://{server}/{organization}/{repo}.git"
- url_https = f"https://{server}/{organization}/{repo}.git"
- url_git = f"git@{server}:{organization}/{repo}.git"
- if not c_path:
- path = f"{repo}"
- else:
- path = f"{c_path}/{organization}_{repo}"
+ manifest_file = self.get_manifest_file(repo_path=repo_path)
+ filename = f"{repo_path}{manifest_file}"
+ lst_repo = []
+ with open(filename) as xml:
+ xml_as_string = xml.read()
+ xml_dict = xmltodict.parse(xml_as_string, dict_constructor=dict)
+ dct_manifest = xml_dict.get("manifest")
+ default_remote = dct_manifest.get("default").get("@remote")
+ lst_remote = dct_manifest.get("remote")
+ if type(lst_remote) is dict:
+ lst_remote = [lst_remote]
+ lst_project = dct_manifest.get("project")
+ if type(lst_project) is dict:
+ lst_project = [lst_project]
+ dct_remote = {a.get("@name"): a.get("@fetch") for a in lst_remote}
+ for project in lst_project:
+ # get name and remote .git
+ path = project.get("@path")
+ name = path
+ url_prefix = dct_remote.get(project.get("@remote"))
+ if not url_prefix:
+ # get default remote
+ url_prefix = dct_remote.get(default_remote)
+ url = f"{url_prefix}{project.get('@name')}"
+ url, url_https, url_git = self.get_url(url)
+ data = {
+ "url": url,
+ "url_https": url_https,
+ "url_git": url_git,
+ "path": path,
+ "relative_path": f"{repo_path}/{path}",
+ "name": name,
+ }
+ lst_repo.append(data)
- name = path
- result.append(
- {
- "url": url,
- "url_https": url_https,
- "url_git": url_git,
- "relative_path": f"{repo_path}/{path}",
- "path": path,
- "name": name,
- }
- )
- return result
+ if add_root:
+ repo_root = Repo(repo_path)
+ url = repo_root.git.remote("get-url", "origin")
+ url, url_https, url_git = self.get_url(url)
+
+ data = {
+ "url": url,
+ "url_https": url_https,
+ "url_git": url_git,
+ "path": repo_path,
+ "name": "",
+ }
+ lst_repo.insert(0, data)
+ # Sort
+ lst_repo = sorted(lst_repo, key=lambda k: k.get("name"))
+ return lst_repo
+
+ def get_manifest_xml_info(self, repo_path: str = "./",
+ add_root: bool = False) -> list:
+ """
+ Get contain of manifest
+ :param repo_path: path of repo to get information about submodule
+ :param add_root: add information about root repository
+ :return: dct_remote, dct_project
+
+ """
+ manifest_file = self.get_manifest_file(repo_path=repo_path)
+ filename = f"{repo_path}/manifest/{manifest_file}"
+ with open(filename) as xml:
+ xml_as_string = xml.read()
+ xml_dict = xmltodict.parse(xml_as_string, dict_constructor=dict)
+ dct_manifest = xml_dict.get("manifest")
+ default_remote = dct_manifest.get("default").get("@remote")
+ lst_remote = dct_manifest.get("remote")
+ lst_project = dct_manifest.get("project")
+ dct_remote = {a.get("@name"): a for a in lst_remote}
+ dct_project = {a.get("@name"): a for a in lst_project}
+ return dct_remote, dct_project
@staticmethod
def get_project_config(repo_path="./"):
@@ -239,7 +298,7 @@ class GitTool:
:param repo_path: path of repo to get information env_var.sh
:return:
{
- CST_GITHUB_TOKEN: TOKEN,
+ CST_EL_GITHUB_TOKEN: TOKEN,
}
"""
filename = f"{repo_path}env_var.sh"
@@ -247,7 +306,7 @@ class GitTool:
txt = file.readlines()
txt = [a[:-1] for a in txt if "=" in a]
- lst_filter = [CST_GITHUB_TOKEN]
+ lst_filter = [CST_EL_GITHUB_TOKEN]
dct_config = {}
# Take filtered value and get bash string values
for f in lst_filter:
@@ -255,7 +314,7 @@ class GitTool:
if f in v:
lst_v = v.split("=")
if len(lst_v) > 1:
- dct_config[CST_GITHUB_TOKEN] = v.split("=")[1][1:-1]
+ dct_config[CST_EL_GITHUB_TOKEN] = v.split("=")[1][1:-1]
return dct_config
@staticmethod
@@ -264,39 +323,25 @@ class GitTool:
if url:
webbrowser.open_new_tab(url)
- def generate_repo_source_from_building(self, repo_path="./"):
- """
- DEPRECATED
- Generate csv file with information about all source addons repo of Odoo
- :param repo_path: Path to build repo source
- :return:
- """
- file_name = f"{repo_path}{CST_FILE_SOURCE_REPO_ADDONS_ODOO}"
- lst_repo_info = self.get_repo_info_from_data_structure(ignore_odoo=True)
- lst_result = [f"{a.get('url_https')}\n" for a in lst_repo_info]
- with open(file_name, "w") as file:
- file.writelines(lst_result)
-
- def generate_odoo_install_locally(self, repo_path="./"):
- # lst_repo = self.get_repo_info_from_data_structure(ignore_odoo=True)
- lst_repo = self.get_repo_info_submodule(repo_path=repo_path)
+ def generate_install_locally(self, repo_path="./"):
+ lst_repo = self.get_repo_info(repo_path=repo_path)
lst_result = []
for repo in lst_repo:
# Exception, ignore addons/OCA_web and root
if "addons/OCA_web" == repo.get("path") or \
"odoo" == repo.get("path"):
continue
- str_repo = f' printf "${{OE_HOME}}/{repo.get("path")}," >> ' \
- f'${{OE_CONFIG_FILE}}\n'
+ str_repo = f' printf "${{EL_HOME}}/{repo.get("path")}," >> ' \
+ f'${{EL_CONFIG_FILE}}\n'
lst_result.append(str_repo)
- with open(f"{repo_path}script/odoo_install_locally.sh") as file:
+ with open(f"{repo_path}script/install_locally.sh") as file:
all_lines = file.readlines()
# search place to add/replace lines
index = 0
find_index = False
index_find = 0
for line in all_lines:
- if not find_index and "if [[ $MINIMAL_ADDONS = \"False\" ]]; then\n" == line:
+ if not find_index and "if [[ $EL_MINIMAL_ADDONS = \"False\" ]]; then\n" == line:
index_find = index + 1
for insert_line in lst_result:
all_lines.insert(index_find, insert_line)
@@ -310,9 +355,119 @@ class GitTool:
index += 1
# create file
- with open(f"{repo_path}script/odoo_install_locally.sh", mode="w") as file:
+ with open(f"{repo_path}script/install_locally.sh", mode="w") as file:
file.writelines(all_lines)
+ @staticmethod
+ def str_insert(source_str, insert_str, pos):
+ return source_str[:pos] + insert_str + source_str[pos:]
+
+ def generate_repo_manifest(self, lst_repo: List[Struct], repo_path: str = "./",
+ dct_remote={}, dct_project={}):
+ lst_remote = []
+ lst_remote_name = []
+ lst_project = []
+ lst_project_name = []
+ lst_default = []
+
+ # Fill with configuration
+ for dct_value in dct_remote.values():
+ lst_remote.append(OrderedDict(
+ [('@name', dct_value.get("@name")),
+ ('@fetch', dct_value.get("@fetch"))]
+ ))
+ lst_remote_name.append(dct_value.get("@name"))
+ for dct_value in dct_project.values():
+ lst_project_info = [
+ ('@name', dct_value.get("@name")),
+ ('@path', dct_value.get("@path")),
+ ('@remote', dct_value.get("@remote"))
+ ]
+ if "@revision" in dct_value.keys():
+ lst_project_info.append(('@revision', dct_value.get("@revision")))
+ if "@clone-depth" in dct_value.keys():
+ lst_project_info.append(('@clone-depth', dct_value.get("@clone-depth")))
+ if "@groups" in dct_value.keys():
+ lst_project_info.append(('@groups', dct_value.get("@groups")))
+ lst_project.append(OrderedDict(lst_project_info))
+ lst_project_name.append(dct_value.get("@name"))
+
+ for repo in lst_repo:
+ if not repo.is_submodule:
+ # Default
+ if lst_default:
+ raise Exception("Cannot have many root repo. "
+ "Validate why 2 or more is not submodule.")
+ lst_default.append(OrderedDict([
+ ('@remote', repo.original_organization),
+ ('@revision', "12.0"),
+ ('@sync-j', "4"),
+ ('@sync-c', "true"),
+ ]))
+ else:
+ # Add remote, only unique remote
+ if repo.original_organization not in lst_remote_name:
+ lst_remote.append(OrderedDict(
+ [('@name', repo.original_organization),
+ ('@fetch', repo.url_https_organization + "/")]
+ ))
+ lst_remote_name.append(repo.original_organization)
+ # Add project, only unique project
+ if repo.project_name not in lst_project_name:
+ lst_project_name.append(repo.project_name)
+ lst_project_info = [
+ ('@name', repo.project_name),
+ ('@path', repo.path),
+ ('@remote', repo.original_organization),
+ ]
+ if repo.revision:
+ lst_project_info.append(('@revision', repo.revision))
+ if repo.clone_depth:
+ lst_project_info.append(('@clone-depth', repo.clone_depth))
+ if repo.sub_path == "addons":
+ lst_project_info.append(('@groups', "addons"))
+ else:
+ lst_project_info.append(('@groups', "odoo"))
+ lst_project.append(OrderedDict(lst_project_info))
+
+ # Order in alphabetic
+ lst_order_remote = sorted(lst_remote, key=lambda key: key.get("@name"))
+ lst_order_default = sorted(lst_default, key=lambda key: key.get("@remote"))
+ lst_order_project = sorted(lst_project, key=lambda key: key.get("@name"))
+
+ dct_repo = OrderedDict(
+ [('manifest', OrderedDict([
+ ('remote', lst_order_remote),
+ ('default', lst_order_default),
+ ('project', lst_order_project),
+ ]))])
+ str_xml_text = xmltodict.unparse(dct_repo, pretty=True)
+
+ pos_insert = str_xml_text.rfind("")
+ if pos_insert:
+ pos_insert += len("")
+ str_xml_text = self.str_insert(str_xml_text, "\n ", pos_insert)
+
+ pos_insert = str_xml_text.rfind("")
+ if pos_insert:
+ pos_insert += len("")
+ str_xml_text = self.str_insert(str_xml_text, "\n ", pos_insert)
+
+ # pos_insert = str_xml_text.rfind("")
+ # if pos_insert:
+ # pos_insert += len("")
+ # str_xml_text = self.str_insert(str_xml_text, "\n ", pos_insert)
+
+ str_xml_text = str_xml_text.replace("> 5 and url[0:4] == "http" and url[-4:] != ".git":
+ url = f"{url}.git"
repo_info = self.get_transformed_repo_info_from_url(url,
repo_path=repo_path,
get_obj=False,
- sub_path=path)
+ sub_path=path,
+ revision=revision,
+ clone_depth=clone_depth)
lst_result.append(repo_info)
return lst_result
+ def get_manifest_file(self, repo_path: str = "./"):
+ """
+ Find .repo and return default manifest file.
+ :param repo_path: path to search .repo
+ :return: manifest file used for Repo
+ """
+ file = f"{repo_path}/.repo/manifest.xml"
+ with open(file) as xml:
+ xml_as_string = xml.read()
+ xml_dict = xmltodict.parse(xml_as_string, dict_constructor=dict)
+ manifest_filename = xml_dict.get("manifest").get("include").get("@name")
+ return manifest_filename
+
def get_matching_repo(self, actual_repo="./", repo_compare_to="./",
- force_normalize_compare=False):
+ force_normalize_compare=False, sync_with_submodule=False):
"""
Compare repo with .gitmodules files
:param actual_repo:
:param repo_compare_to:
:param force_normalize_compare: update name of compare repo
- :return:
+ :param sync_with_submodule: force use submodule with repo_compare_to
+ :return: (list of matches, list of missing, list of more)
"""
- lst_repo_info_actual = self.get_repo_info_submodule(actual_repo)
+ lst_repo_info_actual = self.get_repo_info_manifest_xml(actual_repo)
dct_repo_info_actual = {a.get("name"): a for a in lst_repo_info_actual}
- set_actual = set(dct_repo_info_actual.keys())
+ # set_actual = set(dct_repo_info_actual.keys())
# set_actual_repo = set(
# [a[a.find("_") + 1:] for a in dct_repo_info_actual.keys()])
@@ -389,13 +574,16 @@ class GitTool:
dct_repo_info_actual.items()}
set_actual_repo = set(dct_repo_info_actual_adapted.keys())
- lst_repo_info_compare = self.get_repo_info_submodule(repo_compare_to)
+ lst_repo_info_compare = self.get_repo_info(repo_compare_to,
+ is_manifest=not sync_with_submodule)
if force_normalize_compare:
for repo_info in lst_repo_info_compare:
url_https = repo_info.get("url_https")
url_split = url_https.split("/")
organization = url_split[3]
- repo_name = url_split[4][:-4]
+ repo_name = url_split[4]
+ if repo_name[-4:] == ".git":
+ repo_name = repo_name[:-4]
# name = f"addons/{organization}_{repo_name}"
name = f"{repo_name}"
repo_info["name"] = name
@@ -421,14 +609,34 @@ class GitTool:
dct_repo_info_compare[key]
))
- return lst_match
+ return lst_match, lst_missing_name_normalize, lst_over_name_normalize
@staticmethod
- def sync_to(lst_compare_repo_info):
- i = 0
+ def sync_to(result, checkout_when_diff=False):
+ lst_compare_repo_info, lst_missing_info, lst_over_info = result
+ total = len(lst_missing_info)
+ if total:
+ print(f"\nList of missing : {total}")
+ i = 0
+ for info in lst_missing_info:
+ i += 1
+ print(f"Nb element {i}/{total}")
+ print(f"Missing '{info}'")
+
+ total = len(lst_over_info)
+ if total:
+ print(f"\nList of over : {total}")
+ i = 0
+ for info in lst_over_info:
+ i += 1
+ print(f"Nb element {i}/{total}")
+ print(f"Missing '{info}'")
+
total = len(lst_compare_repo_info)
+ print(f"\nList of normalize : {total}")
lst_same = []
lst_diff = []
+ i = 0
for original, compare_to in lst_compare_repo_info:
i += 1
print(f"Nb element {i}/{total}")
@@ -437,9 +645,15 @@ class GitTool:
repo_compare = Repo(compare_to.get("relative_path"))
commit_compare = repo_compare.head.object.hexsha
if commit_original != commit_compare:
- print(f"DIFF - {original.get('name')}")
+ print(f"DIFF - {original.get('name')} - O {commit_original} - "
+ f"R {commit_compare}")
lst_diff.append((original, compare_to))
- repo_original.git.checkout(commit_compare)
+ if checkout_when_diff:
+ # Update all remote
+ for remote in repo_original.remotes:
+ retry(wait_exponential_multiplier=1000, stop_max_delay=15000)(
+ remote.fetch)()
+ repo_original.git.checkout(commit_compare)
else:
print(f"SAME - {original.get('name')}")
lst_same.append((original, compare_to))
@@ -448,6 +662,13 @@ class GitTool:
@staticmethod
def add_and_fetch_remote(repo_info: Struct, root_repo: Repo = None,
branch_name: str = ""):
+ """
+ Deprecated function, not use anymore git submodule
+ :param repo_info:
+ :param root_repo:
+ :param branch_name:
+ :return:
+ """
try:
working_repo = Repo(repo_info.relative_path)
if repo_info.organization in [a.name for a in working_repo.remotes]:
@@ -509,7 +730,7 @@ class GitTool:
print("Error when forking repo %s" % forked_repo)
exit(1)
else:
- print("Forked %s to %s" % (upstream_url, forked_repo['ssh_url']))
+ print("Forked %s to %s" % (upstream_url, forked_repo['html_url']))
elif status == 202:
print("Forked repo %s already exists" % forked_repo['full_name'])
elif status != 200:
diff --git a/script/odoo_install_OSX_dependancy.sh b/script/install_OSX_dependancy.sh
similarity index 88%
rename from script/odoo_install_OSX_dependancy.sh
rename to script/install_OSX_dependancy.sh
index f6e3398..4ec32c3 100755
--- a/script/odoo_install_OSX_dependancy.sh
+++ b/script/install_OSX_dependancy.sh
@@ -1,13 +1,13 @@
-#!/bin/bash
+#!/usr/bin/env bash
################################################################################
-# Script for installing Odoo on OSX
+# Script for installing ERPLibre on OSX
# Author: Alexandre Ferreira Benevides
#-------------------------------------------------------------------------------
-# This script will install dependency for Odoo on your OSX server.
+# This script will install dependency for ERPLibre on your OSX server.
#-------------------------------------------------------------------------------
################################################################################
-OE_USER=$(whoami)
+EL_USER=$(whoami)
#--------------------------------------------------
# Install PostgreSQL Server
@@ -15,8 +15,8 @@ OE_USER=$(whoami)
echo "\n---- Install PostgreSQL Server ----"
brew install postgresql
-echo "\n---- Creating the ODOO PostgreSQL User ----"
-sudo su - postgres -c "createuser -s ${OE_USER}" 2> /dev/null || true
+echo "\n---- Creating the ERPLibre PostgreSQL User ----"
+sudo su - postgres -c "createuser -s ${EL_USER}" 2> /dev/null || true
#--------------------------------------------------
# Install Dependencies
diff --git a/script/install_daemon.sh b/script/install_daemon.sh
new file mode 100755
index 0000000..586d95c
--- /dev/null
+++ b/script/install_daemon.sh
@@ -0,0 +1,77 @@
+#!/usr/bin/env bash
+
+. ./env_var.sh
+
+#EL_USER="erplibre"
+#EL_HOME="/${EL_USER}"
+#EL_HOME_ERPLIBRE="${EL_HOME}/erplibre"
+#EL_HOME_ODOO="${EL_HOME_ERPLIBRE}/odoo"
+#EL_INSTALL_WKHTMLTOPDF="True"
+#EL_PORT="8069"
+#EL_SUPERADMIN="admin"
+#EL_CONFIG="${EL_USER}"
+
+#--------------------------------------------------
+# Adding ERPLibre as a daemon with SystemD
+#--------------------------------------------------
+echo -e "\n* Create init file"
+sudo rm -f /tmp/${EL_CONFIG}
+cat < /tmp/${EL_CONFIG}
+[Unit]
+Description=${EL_USER}
+Requires=postgresql.service
+After=network.target network-online.target postgresql.service
+
+[Service]
+Type=simple
+SyslogIdentifier=${EL_USER}
+PermissionsStartOnly=true
+User=${EL_USER}
+Group=${EL_USER}
+Restart=always
+RestartSec=5
+PIDFile=${EL_HOME_ERPLIBRE}/venv/service.pid
+ExecStart=${EL_HOME_ERPLIBRE}/venv/run.sh
+StandardOutput=journal+console
+
+[Install]
+WantedBy=multi-user.target
+EOF
+
+echo -e "* Security Init File"
+sudo cp /tmp/${EL_CONFIG} /etc/systemd/system/${EL_CONFIG}.service
+sudo chmod 755 /etc/systemd/system/${EL_CONFIG}.service
+sudo chown root: /etc/systemd/system/${EL_CONFIG}.service
+
+echo -e "* Start ERPLibre on Startup"
+sudo systemctl daemon-reload
+sudo systemctl enable ${EL_CONFIG}.service
+
+sudo su ${EL_USER} -c "sudo rm -f /tmp/${EL_USER}run.sh"
+cat < /tmp/${EL_USER}run.sh
+#!/usr/bin/env bash
+cd ${EL_HOME_ERPLIBRE}
+source ./venv/bin/activate
+python3 ${EL_HOME_ERPLIBRE}/odoo/odoo-bin -c ${EL_HOME_ERPLIBRE}/config.conf $@
+EOF
+
+echo -e "* Security Run File"
+sudo cp /tmp/${EL_USER}run.sh ${EL_HOME_ERPLIBRE}/venv/run.sh
+sudo chmod 755 ${EL_HOME_ERPLIBRE}/venv/run.sh
+sudo chown ${EL_USER}: ${EL_HOME_ERPLIBRE}/venv/run.sh
+
+echo "-----------------------------------------------------------"
+echo "Done! The ERPLibre server is up and running. Specifications:"
+echo "Port: ${EL_PORT}"
+echo "Port Long Polling: ${EL_LONGPOLLING_PORT}"
+echo "User service: ${EL_USER}"
+echo "User PostgreSQL: ${EL_USER}"
+echo "Code location: ${EL_USER}"
+echo "Addons folder: ${EL_USER}/${EL_CONFIG}/addons/"
+echo "Start ERPLibre service: sudo systemctl start ${EL_CONFIG}"
+echo "Stop ERPLibre service: sudo systemctl stop ${EL_CONFIG}"
+echo "Restart ERPLibre service: sudo systemctl restart ${EL_CONFIG}"
+echo "-----------------------------------------------------------"
+
+echo -e "* Starting ERPLibre Service"
+sudo systemctl restart ${EL_CONFIG}.service
diff --git a/script/odoo_install_debian_dependancy.sh b/script/install_debian_dependancy.sh
similarity index 68%
rename from script/odoo_install_debian_dependancy.sh
rename to script/install_debian_dependancy.sh
index a01419b..333a5d9 100755
--- a/script/odoo_install_debian_dependancy.sh
+++ b/script/install_debian_dependancy.sh
@@ -1,19 +1,9 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-################################################################################
+#!/usr/bin/env bash
. ./env_var.sh
-OE_USER=$(whoami)
-# The default port where this Odoo instance will run under (provided you use the command -c in the terminal)
-# Set to true if you want to install it, false if you don't need it or have it already installed.
-#INSTALL_WKHTMLTOPDF="True"
+EL_USER=$(whoami)
+#EL_INSTALL_WKHTMLTOPDF="True"
##
### WKHTMLTOPDF download links
@@ -43,30 +33,30 @@ sudo apt-get upgrade -y
echo -e "\n---- Install PostgreSQL Server ----"
sudo apt-get install postgresql -y
-echo -e "\n---- Creating the ODOO PostgreSQL User ----"
-sudo su - postgres -c "createuser -s $OE_USER" 2> /dev/null || true
+echo -e "\n---- Creating the ERPLibre PostgreSQL User ----"
+sudo su - postgres -c "createuser -s $EL_USER" 2> /dev/null || true
#--------------------------------------------------
# Install Dependencies
#--------------------------------------------------
echo -e "\n--- Installing Python 3 + pip3 --"
-sudo apt-get install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng12-0 gdebi -y
+sudo apt-get install git python3 python3-pip build-essential wget python3-dev python3-venv python3-wheel libxslt-dev libzip-dev libldap2-dev libsasl2-dev python3-setuptools node-less libpng12-0 gdebi-core -y
echo -e "\n---- Installing nodeJS NPM and rtlcss for LTR support ----"
sudo apt-get install nodejs npm -y
sudo npm install -g rtlcss
-if [ ${INSTALL_NGINX} = "True" ]; then
+if [ ${EL_INSTALL_NGINX} = "True" ]; then
sudo apt install nginx -y
fi
#--------------------------------------------------
# Install Wkhtmltopdf if needed
#--------------------------------------------------
-if [ ${INSTALL_WKHTMLTOPDF} = "True" ]; then
+if [ ${EL_INSTALL_WKHTMLTOPDF} = "True" ]; then
INSTALLED=$(dpkg -s wkhtmltox|grep installed)
if [ "" == "${INSTALLED}" ]; then
- echo -e "\n---- Install wkhtml and place shortcuts on correct place for ODOO 12 ----"
+ echo -e "\n---- Install wkhtml and place shortcuts on correct place ----"
#pick up correct one from x64 & x32 versions:
if [ "`getconf LONG_BIT`" == "64" ];then
_url=$WKHTMLTOX_X64
diff --git a/script/odoo_install_dev.sh b/script/install_dev.sh
similarity index 69%
rename from script/odoo_install_dev.sh
rename to script/install_dev.sh
index aa9d204..3572c4f 100755
--- a/script/odoo_install_dev.sh
+++ b/script/install_dev.sh
@@ -1,22 +1,18 @@
-#!/bin/bash
+#!/usr/bin/env bash
################################################################################
-# Script for installing Odoo locally for dev
+# Script for installing ERPLibre locally for dev
# Author: Alexandre Ferreira Benevides
################################################################################
-. ./env_var.sh
-
if [[ "${OSTYPE}" == "linux-gnu" ]]; then
OS=$(lsb_release -si)
if [[ "${OS}" == "Ubuntu" ]]; then
echo "\n---- linux-gnu installation process started ----"
- ./script/odoo_install_debian_dependancy.sh
- ./script/odoo_install_locally.sh
+ ./script/install_debian_dependancy.sh
else
echo "Your Linux system is not supported."
fi
elif [[ "${OSTYPE}" == "darwin"* ]]; then
echo "\n---- Darwin installation process started ----"
- ./script/odoo_install_OSX_dependancy.sh
- ./script/odoo_install_locally.sh
+ ./script/install_OSX_dependancy.sh
fi
diff --git a/script/install_locally.sh b/script/install_locally.sh
new file mode 100755
index 0000000..07cced5
--- /dev/null
+++ b/script/install_locally.sh
@@ -0,0 +1,163 @@
+#!/usr/bin/env bash
+
+. ./env_var.sh
+
+EL_USER=$(whoami)
+EL_HOME=$PWD
+EL_HOME_ODOO="${EL_HOME}/odoo"
+#EL_INSTALL_WKHTMLTOPDF="True"
+#EL_PORT="8069"
+#EL_LONGPOLLING_PORT="8072"
+#EL_SUPERADMIN="admin"
+EL_CONFIG_FILE="${EL_HOME}/config.conf"
+#EL_CONFIG="${EL_USER}"
+#EL_MINIMAL_ADDONS="False"
+#EL_INSTALL_NGINX="True"
+
+if hash python3.7 2>/dev/null; then
+ PYTHON37="True"
+ PYTHON36="False"
+elif hash python3.6 2>/dev/null; then
+ PYTHON37="False"
+ PYTHON36="True"
+else
+ echo "Missing python3.7 or python3.6. Python3.8 is not compatible."
+ exit 1
+fi
+
+echo -e "* Create server config file"
+
+touch ${EL_CONFIG_FILE}
+echo -e "* Creating server config file"
+printf '[options] \n; This is the password that allows database operations:\n' > ${EL_CONFIG_FILE}
+printf "admin_passwd = ${EL_SUPERADMIN}\n" >> ${EL_CONFIG_FILE}
+printf "db_host = False\n" >> ${EL_CONFIG_FILE}
+printf "db_port = False\n" >> ${EL_CONFIG_FILE}
+printf "db_user = ${EL_USER}\n" >> ${EL_CONFIG_FILE}
+printf "db_password = False\n" >> ${EL_CONFIG_FILE}
+printf "xmlrpc_port = ${EL_PORT}\n" >> ${EL_CONFIG_FILE}
+printf "longpolling_port = ${EL_LONGPOLLING_PORT}\n" >> ${EL_CONFIG_FILE}
+
+printf "addons_path = ${EL_HOME_ODOO}/addons,${EL_HOME}/addons/addons," >> ${EL_CONFIG_FILE}
+printf "${EL_HOME}/addons/OCA_web," >> ${EL_CONFIG_FILE}
+if [[ $EL_MINIMAL_ADDONS = "False" ]]; then
+ printf "${EL_HOME}/addons/ERPLibre_erplibre_addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/MathBenTech_development," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/MathBenTech_odoo-business-spending-management-quebec-canada," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/MathBenTech_scrummer," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-base-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-entertainment-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-git-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-hr-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-partner-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-product-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-project-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-purchase-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-stock-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-survey-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-timesheet-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Numigi_odoo-web-addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-analytic," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-budgeting," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-closing," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-consolidation," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-financial-reporting," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-financial-tools," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-fiscal-rule," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-invoice-reporting," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-invoicing," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-payment," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_account-reconcile," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_apps-store," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_bank-payment," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_bank-statement-import," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_brand," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_business-requirement," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_commission," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_community-data-files," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_connector-telephony," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_contract," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_credit-control," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_currency," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_data-protection," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_donation," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_e-commerce," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_edi," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_event," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_helpdesk," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_hr," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_knowledge," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_l10n-canada," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_maintenance," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_management-system," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_manufacture," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_margin-analysis," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_mis-builder," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_multi-company," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_partner-contact," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_pos," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_product-attribute," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_product-pack," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_product-variant," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_project," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_project-reporting," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_purchase-workflow," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_queue," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_reporting-engine," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_sale-workflow," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_server-auth," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_server-brand," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_server-env," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_server-tools," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_server-ux," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_social," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_stock-logistics-warehouse," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_timesheet," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_website," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/OCA_wms," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/SanteLibre_santelibre_addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/Smile-SA_odoo_addons," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_base," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_dms," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_docs," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_misc," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_quality," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_web," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/muk-it_muk_website," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/odooaktiv_QuotationRevision," >> ${EL_CONFIG_FILE}
+ printf "${EL_HOME}/addons/openeducat_openeducat_erp," >> ${EL_CONFIG_FILE}
+fi
+printf "\n" >> ${EL_CONFIG_FILE}
+
+printf "workers = 0\n" >> ${EL_CONFIG_FILE}
+printf "max_cron_threads = 2\n" >> ${EL_CONFIG_FILE}
+
+if [ ${EL_INSTALL_NGINX} = "True" ]; then
+ printf "xmlrpc_interface = 127.0.0.1\n" >> ${EL_CONFIG_FILE}
+ printf "netrpc_interface = 127.0.0.1\n" >> ${EL_CONFIG_FILE}
+ printf "proxy_mode = True\n" >> ${EL_CONFIG_FILE}
+fi
+
+echo -e "\n---- Install Odoo with addons module ----"
+git submodule update --init
+
+# Generate empty addons if missing
+if [ ! -d "./addons/addons" ]; then
+ mkdir -p ./addons/addons
+fi
+
+echo -e "\n---- Create Virtual environment Python ----"
+cd ${EL_HOME}
+if [[ ${PYTHON37} = "True" ]]; then
+ python3.7 -m venv venv
+elif [[ ${PYTHON36} = "True" ]]; then
+ python3.6 -m venv venv
+fi
+cd -
+
+# Install git-repo if missing
+if [ ! -f "./venv/repo" ]; then
+ echo "Install git-repo from Google APIS"
+ curl https://storage.googleapis.com/git-repo-downloads/repo > ./venv/repo
+ chmod +x ./venv/repo
+fi
diff --git a/script/install_locally_dev.sh b/script/install_locally_dev.sh
new file mode 100755
index 0000000..671f74d
--- /dev/null
+++ b/script/install_locally_dev.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+
+. ./env_var.sh
+
+EL_USER=$(whoami)
+EL_HOME=$PWD
+EL_HOME_ODOO="${EL_HOME}/odoo"
+#EL_INSTALL_WKHTMLTOPDF="True"
+#EL_PORT="8069"
+#EL_LONGPOLLING_PORT="8072"
+#EL_SUPERADMIN="admin"
+EL_CONFIG_FILE="${EL_HOME}/config.conf"
+#EL_CONFIG="${EL_USER}"
+#EL_MINIMAL_ADDONS="False"
+#EL_INSTALL_NGINX="True"
+#EL_MANIFEST_PROD="./manifest/default.xml"
+#EL_MANIFEST_DEV="./manifest/default.dev.xml"
+
+./script/install_locally.sh
+
+# Update git-repo
+git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
+DAEMON_PID=$!
+
+./venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ${EL_MANIFEST_DEV}
+./venv/repo sync -m ${EL_MANIFEST_DEV}
+
+kill ${DAEMON_PID}
+
+echo -e "\n---- Install python packages/requirements ----"
+${EL_HOME}/venv/bin/pip3 install --upgrade pip
+${EL_HOME}/venv/bin/pip3 install wheel phonenumbers
+${EL_HOME}/venv/bin/pip3 install -r "${EL_HOME}/odoo/requirements.txt"
+${EL_HOME}/venv/bin/pip3 install -r "${EL_HOME}/requirements.txt"
+
+# For dev/testing
+${EL_HOME}/venv/bin/pip3 install websocket-client
+
+echo -e "\n---- Add link dependency in site-packages of Python ----"
+if [[ ${PYTHON37} = "True" ]]; then
+ ln -fs ${EL_HOME_ODOO}/odoo ${EL_HOME}/venv/lib/python3.7/site-packages/
+elif [[ ${PYTHON36} = "True" ]]; then
+ ln -fs ${EL_HOME_ODOO}/odoo ${EL_HOME}/venv/lib/python3.6/site-packages/
+fi
diff --git a/script/install_locally_prod.sh b/script/install_locally_prod.sh
new file mode 100755
index 0000000..77f158d
--- /dev/null
+++ b/script/install_locally_prod.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+. ./env_var.sh
+
+EL_USER=$(whoami)
+EL_HOME=$PWD
+EL_HOME_ODOO="${EL_HOME}/odoo"
+#EL_INSTALL_WKHTMLTOPDF="True"
+#EL_PORT="8069"
+#EL_LONGPOLLING_PORT="8072"
+#EL_SUPERADMIN="admin"
+EL_CONFIG_FILE="${EL_HOME}/config.conf"
+#EL_CONFIG="${EL_USER}"
+#EL_MINIMAL_ADDONS="False"
+#EL_INSTALL_NGINX="True"
+#EL_MANIFEST_PROD="./manifest/default.xml"
+#EL_MANIFEST_DEV="./manifest/default.dev.xml"
+
+./script/install_locally.sh
+
+# Update git-repo
+./venv/repo init -u http://git.erplibre.ca/ERPLibre -b 12.0_repo
+#./venv/repo sync --force-sync
+./venv/repo sync
+
+echo -e "\n---- Install python packages/requirements ----"
+${EL_HOME}/venv/bin/pip3 install --upgrade pip
+${EL_HOME}/venv/bin/pip3 install wheel phonenumbers
+${EL_HOME}/venv/bin/pip3 install -r "${EL_HOME}/odoo/requirements.txt"
+${EL_HOME}/venv/bin/pip3 install -r "${EL_HOME}/requirements.txt"
+
+# For dev/testing
+${EL_HOME}/venv/bin/pip3 install websocket-client
+
+echo -e "\n---- Add link dependency in site-packages of Python ----"
+if [[ ${PYTHON37} = "True" ]]; then
+ ln -fs ${EL_HOME_ODOO}/odoo ${EL_HOME}/venv/lib/python3.7/site-packages/
+elif [[ ${PYTHON36} = "True" ]]; then
+ ln -fs ${EL_HOME_ODOO}/odoo ${EL_HOME}/venv/lib/python3.6/site-packages/
+fi
diff --git a/script/install_production.sh b/script/install_production.sh
new file mode 100755
index 0000000..397fb0a
--- /dev/null
+++ b/script/install_production.sh
@@ -0,0 +1,48 @@
+#!/usr/bin/env bash
+
+. ./env_var.sh
+
+./script/install_debian_dependancy.sh
+
+echo -e "\n---- Create ERPLIBRE system user ----"
+sudo adduser --system --quiet --shell=/bin/bash --home=/${EL_USER} --gecos 'ERPLIBRE' --group ${EL_USER}
+#The user should also be added to the sudo'ers group.
+sudo adduser ${EL_USER} sudo
+
+echo -e "\n---- Creating the ERPLIBRE PostgreSQL User ----"
+sudo su - postgres -c "createuser -s ${EL_USER}" 2> /dev/null || true
+
+#echo -e "\n---- Create Log directory ----"
+#sudo mkdir /var/log/${EL_USER}
+#sudo chown ${EL_USER}:${EL_USER} /var/log/${EL_USER}
+
+echo -e "\n---- Setting permissions on home folder ----"
+sudo mkdir -p ${EL_HOME}
+sudo chown -R ${EL_USER}:${EL_USER} ${EL_HOME}
+
+#--------------------------------------------------
+# Install ERPLIBRE
+#--------------------------------------------------
+echo -e "\n==== Clone this installation ===="
+REMOTE_URL_GIT=`git remote get-url origin`
+BRANCH_GIT=`git rev-parse --abbrev-ref HEAD`
+sudo su ${EL_USER} -c "git clone --branch ${BRANCH_GIT} ${REMOTE_URL_GIT} ${EL_HOME_ERPLIBRE}"
+sudo cp ./env_var.sh ${EL_HOME_ERPLIBRE}
+sudo chown -R ${EL_USER}:${EL_USER} ${EL_HOME_ERPLIBRE}/env_var.sh
+
+LAST_PWD=$PWD
+cd ${EL_HOME_ERPLIBRE}
+sudo su ${EL_USER} -c "./script/install_locally_prod.sh"
+cd ${LAST_PWD}
+#echo -e "\n* Updating server config file"
+#sudo su ${EL_USER} -c "printf 'logfile = /var/log/${EL_USER}/${EL_CONFIG}.log\n' >> /${EL_USER}/erplibre/config.conf"
+
+#--------------------------------------------------
+# Adding ERPLIBRE as a daemon
+#--------------------------------------------------
+./script/install_daemon.sh
+
+#--------------------------------------------------
+# Install Nginx if needed
+#--------------------------------------------------
+./script/install_production_nginx.sh
\ No newline at end of file
diff --git a/script/odoo_install_production_nginx.sh b/script/install_production_nginx.sh
similarity index 57%
rename from script/odoo_install_production_nginx.sh
rename to script/install_production_nginx.sh
index 5f613d4..84693ac 100755
--- a/script/odoo_install_production_nginx.sh
+++ b/script/install_production_nginx.sh
@@ -1,34 +1,26 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-################################################################################
+#!/usr/bin/env bash
. ./env_var.sh
#--------------------------------------------------
# Install Nginx if needed
#--------------------------------------------------
-if [ ${INSTALL_NGINX} = "True" ]; then
+if [ ${EL_INSTALL_NGINX} = "True" ]; then
echo -e "\n---- Installing and setting up Nginx ----"
- cat < /tmp/nginx${OE_USER}
-upstream odoo${OE_USER} {
- server 127.0.0.1:${OE_PORT};
+ cat < /tmp/nginx${EL_USER}
+upstream erplibre${EL_USER} {
+ server 127.0.0.1:${EL_PORT};
}
-upstream odoo${OE_USER}chat {
- server 127.0.0.1:${OE_LONGPOLLING_PORT};
+upstream erplibre${EL_USER}chat {
+ server 127.0.0.1:${EL_LONGPOLLING_PORT};
}
server {
listen 80;
- server_name ${WEBSITE_NAME};
+ server_name ${EL_WEBSITE_NAME};
- # Add Headers for odoo proxy mode
+ # Add Headers for erplibre proxy mode
proxy_set_header X-Forwarded-Host \$host;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
@@ -36,9 +28,9 @@ server {
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
- # odoo request log files
- access_log /var/log/nginx/${OE_USER}-access.log;
- error_log /var/log/nginx/${OE_USER}-error.log;
+ # erplibre request log files
+ access_log /var/log/nginx/${EL_USER}-access.log;
+ error_log /var/log/nginx/${EL_USER}-error.log;
# Increase proxy buffer size
proxy_buffers 16 64k;
@@ -68,13 +60,13 @@ server {
client_max_body_size 1024M;
location / {
- proxy_pass http://odoo${OE_USER};
+ proxy_pass http://erplibre${EL_USER};
# by default, do not forward anything
proxy_redirect off;
}
location /longpolling {
- proxy_pass http://odoo${OE_USER}chat;
+ proxy_pass http://erplibre${EL_USER}chat;
}
# cache some static data in memory for 60mins.
@@ -83,16 +75,16 @@ server {
proxy_cache_valid 404 1m;
proxy_buffering on;
expires 864000;
- proxy_pass http://odoo${OE_USER};
+ proxy_pass http://erplibre${EL_USER};
}
}
EOF
- sudo mv -f /tmp/nginx${OE_USER} /etc/nginx/sites-available/${WEBSITE_NAME}
- sudo ln -fs /etc/nginx/sites-available/${WEBSITE_NAME} /etc/nginx/sites-enabled/${WEBSITE_NAME}
+ sudo mv -f /tmp/nginx${EL_USER} /etc/nginx/sites-available/${EL_WEBSITE_NAME}
+ sudo ln -fs /etc/nginx/sites-available/${EL_WEBSITE_NAME} /etc/nginx/sites-enabled/${EL_WEBSITE_NAME}
sudo rm -f /etc/nginx/sites-enabled/default /etc/nginx/sites-available/default
sudo systemctl restart nginx
- echo "Done! The Nginx server is up and running. Configuration can be found at /etc/nginx/sites-enabled/${WEBSITE_NAME}"
+ echo "Done! The Nginx server is up and running. Configuration can be found at /etc/nginx/sites-enabled/${EL_WEBSITE_NAME}"
echo "Run manually certbot : sudo certbot --nginx"
else
echo "Nginx isn't installed due to choice of the user!"
diff --git a/script/list_repo_diff.py b/script/list_repo_diff.py
deleted file mode 100644
index dd9fa11..0000000
--- a/script/list_repo_diff.py
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env python
-import os
-import sys
-import webbrowser
-import argparse
-import logging
-from git import Repo
-
-from retrying import retry # pip install retrying
-
-new_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
-sys.path.append(new_path)
-
-from script.git_tool import GitTool
-from script import fork_github_repo
-
-_logger = logging.getLogger(__name__)
-CST_GITHUB_TOKEN = "GITHUB_TOKEN"
-
-
-def get_config():
- """Parse command line arguments, extracting the config file name,
- returning the union of config file and command line arguments
-
- :return: dict of config file settings and command line arguments
- """
- # TODO update description
- parser = argparse.ArgumentParser(
- formatter_class=argparse.RawDescriptionHelpFormatter,
- description='''\
-''',
- epilog='''\
-'''
- )
- parser.add_argument('-d', '--dir', dest="dir", default="./",
- help="Path of repo to change remote, including submodule.")
- args = parser.parse_args()
- return args
-
-
-def main():
- config = get_config()
- lst_repo = GitTool.get_repo_info_submodule(repo_path=config.dir)
- branch_search = "12.0"
- # repo = Repo(root_path)
- # repo_root = Repo(".")
- lst_result = []
-
- i = 0
- total = len(lst_repo)
- for repo in lst_repo:
- i += 1
- print(f"Nb element {i}/{total}")
- repo_dir_root = repo.get("path")
- remote_path = f"{config.dir}/{repo_dir_root}"
- repo_root = Repo(remote_path)
- repo_branch_search_sha = [a.object.hexsha for a in repo_root.branches if
- branch_search in a.name]
- if repo_branch_search_sha:
- repo_branch_search_sha = repo_branch_search_sha[0]
- else:
- print(f"Error, missing branch {branch_search} in {remote_path}")
- continue
- lst_result.append((remote_path, repo_root.head.commit.hexsha,
- repo_root.head.commit.hexsha != repo_branch_search_sha))
-
- # print(repo_root)
-
- # # Create the remote upstream
- # split_url = url.split("/")
- # split_url[-2] = upstream_name
- # upstream_url = "/".join(split_url)
- #
- # cloned_repo = Repo(repo_dir_root)
- # try:
- # upstream_remote = cloned_repo.remote(upstream_name)
- # print('Remote "%s" already exists in %s' %
- # (upstream_name, repo_dir_root))
- # except ValueError:
- # upstream_remote = retry(
- # wait_exponential_multiplier=1000,
- # stop_max_delay=15000
- # )(cloned_repo.create_remote)(upstream_name, upstream_url)
- # print('Remote "%s" created for %s' % (upstream_name, upstream_url))
- #
- # try:
- # # Fetch the remote upstream
- # retry(wait_exponential_multiplier=1000, stop_max_delay=15000)(
- # upstream_remote.fetch)()
- # print('Remote "%s" fetched' % upstream_name)
- # except Exception:
- # print(f"ERROR git {repo_dir_root} remote {upstream_name} not exist.")
- # upstream_remote.remove(upstream_remote, upstream_name)
-
- i = 0
- i_len = len(lst_result)
- for path, hash, diff in lst_result:
- i += 1
- if diff:
- print(f"{i:02d}/{i_len} {diff} {path}\t{hash}")
-
- # lst_repo = GitTool.get_repo_info_from_data_structure()
- # for repo in lst_repo:
- # repo_dir_root = repo.get("path")
- # repo_root = Repo(remote_path)
- # repo_root.git.checkout()
-
-
-if __name__ == '__main__':
- main()
diff --git a/script/odoo_install_daemon.sh b/script/odoo_install_daemon.sh
deleted file mode 100755
index ecf2b13..0000000
--- a/script/odoo_install_daemon.sh
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-################################################################################
-
-. ./env_var.sh
-
-#OE_USER="odoo"
-#OE_HOME="/${OE_USER}/odoo"
-#OE_HOME_EXT="/${OE_USER}/odoo/odoo/odoo"
-## The default port where this Odoo instance will run under (provided you use the command -c in the terminal)
-## Set to true if you want to install it, false if you don't need it or have it already installed.
-#INSTALL_WKHTMLTOPDF="True"
-## Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
-#OE_PORT="8069"
-## set the superadmin password
-#OE_SUPERADMIN="admin"
-#OE_CONFIG="${OE_USER}"
-
-#--------------------------------------------------
-# Adding ODOO as a deamon with SystemD
-#--------------------------------------------------
-echo -e "\n* Create init file"
-sudo rm -f /tmp/${OE_CONFIG}
-cat < /tmp/${OE_CONFIG}
-[Unit]
-Description=${OE_USER}
-Requires=postgresql.service
-After=network.target network-online.target postgresql.service
-
-[Service]
-Type=simple
-SyslogIdentifier=${OE_USER}
-PermissionsStartOnly=true
-User=${OE_USER}
-Group=${OE_USER}
-Restart=always
-RestartSec=5
-PIDFile=${OE_HOME_ODOO}/venv/service.pid
-ExecStart=${OE_HOME_ODOO}/venv/run.sh
-StandardOutput=journal+console
-
-[Install]
-WantedBy=multi-user.target
-EOF
-
-echo -e "* Security Init File"
-sudo cp /tmp/${OE_CONFIG} /etc/systemd/system/${OE_CONFIG}.service
-sudo chmod 755 /etc/systemd/system/${OE_CONFIG}.service
-sudo chown root: /etc/systemd/system/${OE_CONFIG}.service
-
-echo -e "* Start ODOO on Startup"
-sudo systemctl daemon-reload
-sudo systemctl enable ${OE_CONFIG}.service
-
-sudo su ${OE_USER} -c "sudo rm -f /tmp/${OE_USER}run.sh"
-cat < /tmp/${OE_USER}run.sh
-#!/usr/bin/env bash
-cd ${OE_HOME_ODOO}
-source ./venv/bin/activate
-python3 ${OE_HOME_ODOO}/odoo/odoo-bin -c ${OE_HOME_ODOO}/config.conf
-EOF
-
-echo -e "* Security Run File"
-sudo cp /tmp/${OE_USER}run.sh ${OE_HOME_ODOO}/venv/run.sh
-sudo chmod 755 ${OE_HOME_ODOO}/venv/run.sh
-sudo chown ${OE_USER}: ${OE_HOME_ODOO}/venv/run.sh
-
-echo "-----------------------------------------------------------"
-echo "Done! The Odoo server is up and running. Specifications:"
-echo "Port: ${OE_PORT}"
-echo "Port Long Polling: ${OE_LONGPOLLING_PORT}"
-echo "User service: ${OE_USER}"
-echo "User PostgreSQL: ${OE_USER}"
-echo "Code location: ${OE_USER}"
-echo "Addons folder: ${OE_USER}/${OE_CONFIG}/addons/"
-echo "Start Odoo service: sudo systemctl start ${OE_CONFIG}"
-echo "Stop Odoo service: sudo systemctl stop ${OE_CONFIG}"
-echo "Restart Odoo service: sudo systemctl restart ${OE_CONFIG}"
-echo "-----------------------------------------------------------"
-
-echo -e "* Starting Odoo Service"
-sudo systemctl restart ${OE_CONFIG}.service
diff --git a/script/odoo_install_locally.sh b/script/odoo_install_locally.sh
deleted file mode 100755
index 6489b71..0000000
--- a/script/odoo_install_locally.sh
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-# Make a new file:
-# sudo nano odoo-install.sh
-# Place this content in it and then make the file executable:
-# sudo chmod +x odoo-install.sh
-# Execute the script to install Odoo:
-# ./odoo-install
-################################################################################
-
-. ./env_var.sh
-
-OE_USER=$(whoami)
-OE_HOME=$PWD
-OE_HOME_EXT="${OE_HOME}/odoo"
-# The default port where this Odoo instance will run under (provided you use the command -c in the terminal)
-# Set to true if you want to install it, false if you don't need it or have it already installed.
-#INSTALL_WKHTMLTOPDF="True"
-# Set the default Odoo port (you still have to use -c /etc/odoo-server.conf for example to use this.)
-#OE_PORT="8069"
-#OE_LONGPOLLING_PORT="8072"
-# Choose the Odoo version which you want to install. For example: 12.0, 11.0, 10.0 or saas-18. When using 'master' the master version will be installed.
-# IMPORTANT! This script contains extra libraries that are specifically needed for Odoo 12.0
-#OE_VERSION="stable_prod_12.0"
-# set the superadmin password
-#OE_SUPERADMIN="admin"
-OE_CONFIG_FILE="${OE_HOME}/config.conf"
-#OE_CONFIG="${OE_USER}"
-#MINIMAL_ADDONS="False"
-#INSTALL_NGINX="True"
-
-if hash python3.7 2>/dev/null; then
- PYTHON37="True"
- PYTHON36="False"
-elif hash python3.6 2>/dev/null; then
- PYTHON37="False"
- PYTHON36="True"
-else
- echo "Missing python3.7 or python3.6. Python3.8 is not compatible."
- exit 1
-fi
-
-echo -e "* Create server config file"
-
-touch ${OE_CONFIG_FILE}
-echo -e "* Creating server config file"
-printf '[options] \n; This is the password that allows database operations:\n' > ${OE_CONFIG_FILE}
-printf "admin_passwd = ${OE_SUPERADMIN}\n" >> ${OE_CONFIG_FILE}
-printf "db_host = False\n" >> ${OE_CONFIG_FILE}
-printf "db_port = False\n" >> ${OE_CONFIG_FILE}
-printf "db_user = ${OE_USER}\n" >> ${OE_CONFIG_FILE}
-printf "db_password = False\n" >> ${OE_CONFIG_FILE}
-printf "xmlrpc_port = ${OE_PORT}\n" >> ${OE_CONFIG_FILE}
-printf "longpolling_port = ${OE_LONGPOLLING_PORT}\n" >> ${OE_CONFIG_FILE}
-
-printf "addons_path = ${OE_HOME_EXT}/addons,${OE_HOME}/addons/addons," >> ${OE_CONFIG_FILE}
-printf "${OE_HOME}/addons/OCA_web," >> ${OE_CONFIG_FILE}
-if [[ $MINIMAL_ADDONS = "False" ]]; then
- printf "${OE_HOME}/addons/ERPLibre_erplibre_addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/MathBenTech_development," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/MathBenTech_odoo-business-spending-management-quebec-canada," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/MathBenTech_scrummer," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-base-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-entertainment-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-git-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-hr-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-partner-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-product-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-project-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-purchase-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-stock-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-survey-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-timesheet-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Numigi_odoo-web-addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-analytic," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-budgeting," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-closing," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-consolidation," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-financial-reporting," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-financial-tools," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-fiscal-rule," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-invoice-reporting," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-invoicing," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-payment," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_account-reconcile," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_apps-store," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_bank-payment," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_bank-statement-import," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_brand," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_business-requirement," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_commission," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_community-data-files," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_connector-telephony," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_contract," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_credit-control," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_currency," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_data-protection," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_donation," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_e-commerce," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_edi," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_event," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_helpdesk," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_hr," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_knowledge," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_l10n-canada," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_maintenance," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_management-system," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_manufacture," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_margin-analysis," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_mis-builder," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_multi-company," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_partner-contact," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_pos," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_product-attribute," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_product-pack," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_product-variant," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_project," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_project-reporting," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_purchase-workflow," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_queue," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_reporting-engine," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_sale-workflow," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_server-auth," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_server-brand," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_server-env," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_server-tools," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_server-ux," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_social," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_stock-logistics-warehouse," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_timesheet," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_website," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/OCA_wms," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/SanteLibre_santelibre_addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/Smile-SA_odoo_addons," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_base," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_dms," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_docs," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_misc," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_quality," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_web," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/muk-it_muk_website," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/odooaktiv_QuotationRevision," >> ${OE_CONFIG_FILE}
- printf "${OE_HOME}/addons/openeducat_openeducat_erp," >> ${OE_CONFIG_FILE}
-fi
-printf "\n" >> ${OE_CONFIG_FILE}
-
-printf "workers = 0\n" >> ${OE_CONFIG_FILE}
-printf "max_cron_threads = 2\n" >> ${OE_CONFIG_FILE}
-
-if [ ${INSTALL_NGINX} = "True" ]; then
- printf "xmlrpc_interface = 127.0.0.1\n" >> ${OE_CONFIG_FILE}
- printf "netrpc_interface = 127.0.0.1\n" >> ${OE_CONFIG_FILE}
- printf "proxy_mode = True\n" >> ${OE_CONFIG_FILE}
-fi
-
-echo -e "\n---- Install Odoo with addons module ----"
-git submodule update --init
-
-echo -e "\n---- Create Virtual environment Python ----"
-cd ${OE_HOME}
-if [[ ${PYTHON37} = "True" ]]; then
- python3.7 -m venv venv
-elif [[ ${PYTHON36} = "True" ]]; then
- python3.6 -m venv venv
-fi
-cd -
-
-echo -e "\n---- Install python packages/requirements ----"
-${OE_HOME}/venv/bin/pip3 install --upgrade pip
-${OE_HOME}/venv/bin/pip3 install wheel phonenumbers
-${OE_HOME}/venv/bin/pip3 install -r "${OE_HOME}/odoo/requirements.txt"
-${OE_HOME}/venv/bin/pip3 install -r "${OE_HOME}/requirements.txt"
-
-# For dev/testing
-${OE_HOME}/venv/bin/pip3 install websocket-client
-
-echo -e "\n---- Add link dependency in site-packages of Python ----"
-if [[ ${PYTHON37} = "True" ]]; then
- ln -fs ${OE_HOME_EXT}/odoo ${OE_HOME}/venv/lib/python3.7/site-packages/
-elif [[ ${PYTHON36} = "True" ]]; then
- ln -fs ${OE_HOME_EXT}/odoo ${OE_HOME}/venv/lib/python3.6/site-packages/
-fi
diff --git a/script/odoo_install_production.sh b/script/odoo_install_production.sh
deleted file mode 100755
index c770f4f..0000000
--- a/script/odoo_install_production.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/bash
-################################################################################
-# Script for installing Odoo on Ubuntu 14.04, 15.04, 16.04 and 18.04 (could be used for other version too)
-# Author: Yenthe Van Ginneken
-#-------------------------------------------------------------------------------
-# This script will install Odoo on your Ubuntu 16.04 server. It can install multiple Odoo instances
-# in one Ubuntu because of the different xmlrpc_ports
-#-------------------------------------------------------------------------------
-################################################################################
-
-. ./env_var.sh
-
-./script/odoo_install_debian_dependancy.sh
-
-echo -e "\n---- Create ODOO system user ----"
-sudo adduser --system --quiet --shell=/bin/bash --home=/${OE_USER} --gecos 'ODOO' --group ${OE_USER}
-#The user should also be added to the sudo'ers group.
-sudo adduser ${OE_USER} sudo
-
-echo -e "\n---- Creating the ODOO PostgreSQL User ----"
-sudo su - postgres -c "createuser -s ${OE_USER}" 2> /dev/null || true
-
-#echo -e "\n---- Create Log directory ----"
-#sudo mkdir /var/log/${OE_USER}
-#sudo chown ${OE_USER}:${OE_USER} /var/log/${OE_USER}
-
-echo -e "\n---- Setting permissions on home folder ----"
-sudo mkdir -p ${OE_HOME}
-sudo chown -R ${OE_USER}:${OE_USER} ${OE_HOME}
-
-#--------------------------------------------------
-# Install ODOO
-#--------------------------------------------------
-echo -e "\n==== Clone this installation ===="
-REMOTE_URL_GIT=`git remote get-url origin`
-BRANCH_GIT=`git rev-parse --abbrev-ref HEAD`
-sudo su ${OE_USER} -c "git clone --branch ${BRANCH_GIT} ${REMOTE_URL_GIT} ${OE_HOME_ODOO}"
-sudo cp ./env_var.sh ${OE_HOME_ODOO}
-sudo chown -R ${OE_USER}:${OE_USER} ${OE_HOME_ODOO}/env_var.sh
-
-LAST_PWD=$PWD
-cd ${OE_HOME_ODOO}
-sudo su ${OE_USER} -c "./script/odoo_install_locally.sh"
-cd ${LAST_PWD}
-#echo -e "\n* Updating server config file"
-#sudo su ${OE_USER} -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /${OE_USER}/odoo/config.conf"
-
-#--------------------------------------------------
-# Adding ODOO as a daemon
-#--------------------------------------------------
-./script/odoo_install_daemon.sh
-
-#--------------------------------------------------
-# Install Nginx if needed
-#--------------------------------------------------
-./script/odoo_install_production_nginx.sh
\ No newline at end of file
diff --git a/source_repo_addons.csv b/source_repo_addons.csv
new file mode 100644
index 0000000..2f64738
--- /dev/null
+++ b/source_repo_addons.csv
@@ -0,0 +1,88 @@
+url,path,revision,clone-depth
+https://github.com/ERPLibre/erplibre_addons.git,addons,,
+https://github.com/MathBenTech/development.git,addons,,
+https://github.com/MathBenTech/odoo-business-spending-management-quebec-canada.git,addons,stable_prod_12.0,
+https://github.com/MathBenTech/scrummer.git,addons,,
+https://github.com/muk-it/muk_base.git,addons,,
+https://github.com/muk-it/muk_dms.git,addons,,
+https://github.com/muk-it/muk_docs.git,addons,,
+https://github.com/muk-it/muk_misc.git,addons,,
+https://github.com/muk-it/muk_quality.git,addons,,
+https://github.com/muk-it/muk_web.git,addons,,
+https://github.com/muk-it/muk_website.git,addons,,
+https://github.com/Numigi/odoo-base-addons.git,addons,,
+https://github.com/Numigi/odoo-entertainment-addons.git,addons,,
+https://github.com/Numigi/odoo-git-addons.git,addons,,
+https://github.com/Numigi/odoo-hr-addons.git,addons,,
+https://github.com/Numigi/odoo-partner-addons.git,addons,,
+https://github.com/Numigi/odoo-product-addons.git,addons,,
+https://github.com/Numigi/odoo-project-addons.git,addons,,
+https://github.com/Numigi/odoo-purchase-addons.git,addons,,
+https://github.com/Numigi/odoo-stock-addons.git,addons,,
+https://github.com/Numigi/odoo-survey-addons.git,addons,,
+https://github.com/Numigi/odoo-timesheet-addons.git,addons,,
+https://github.com/Numigi/odoo-web-addons.git,addons,,
+https://github.com/OCA/account-analytic.git,addons,,
+https://github.com/OCA/account-budgeting.git,addons,,
+https://github.com/OCA/account-closing.git,addons,,
+https://github.com/OCA/account-consolidation.git,addons,,
+https://github.com/OCA/account-financial-reporting.git,addons,,
+https://github.com/OCA/account-financial-tools.git,addons,,
+https://github.com/OCA/account-fiscal-rule.git,addons,,
+https://github.com/OCA/account-invoicing.git,addons,,
+https://github.com/OCA/account-invoice-reporting.git,addons,,
+https://github.com/OCA/account-payment.git,addons,,
+https://github.com/OCA/account-reconcile.git,addons,,
+https://github.com/OCA/apps-store.git,addons,,
+https://github.com/OCA/bank-payment.git,addons,,
+https://github.com/OCA/bank-statement-import.git,addons,,
+https://github.com/OCA/brand.git,addons,,
+https://github.com/OCA/business-requirement.git,addons,,
+https://github.com/OCA/commission.git,addons,,
+https://github.com/OCA/community-data-files.git,addons,,
+https://github.com/OCA/connector-telephony.git,addons,,
+https://github.com/OCA/contract.git,addons,,
+https://github.com/OCA/credit-control.git,addons,,
+https://github.com/OCA/currency.git,addons,,
+https://github.com/OCA/data-protection.git,addons,,
+https://github.com/OCA/donation.git,addons,,
+https://github.com/OCA/e-commerce.git,addons,,
+https://github.com/OCA/edi.git,addons,,
+https://github.com/OCA/event.git,addons,,
+https://github.com/OCA/helpdesk.git,addons,,
+https://github.com/OCA/hr.git,addons,,
+https://github.com/OCA/knowledge.git,addons,,
+https://github.com/OCA/l10n-canada.git,addons,,
+https://github.com/OCA/maintenance.git,addons,,
+https://github.com/OCA/management-system.git,addons,,
+https://github.com/OCA/manufacture.git,addons,,
+https://github.com/OCA/margin-analysis.git,addons,,
+https://github.com/OCA/mis-builder.git,addons,,
+https://github.com/OCA/multi-company.git,addons,,
+https://github.com/OCA/partner-contact.git,addons,,
+https://github.com/OCA/pos.git,addons,,
+https://github.com/OCA/product-attribute.git,addons,,
+https://github.com/OCA/product-pack.git,addons,,
+https://github.com/OCA/product-variant.git,addons,,
+https://github.com/OCA/project.git,addons,,
+https://github.com/OCA/project-reporting.git,addons,,
+https://github.com/OCA/purchase-workflow.git,addons,,
+https://github.com/OCA/queue.git,addons,,
+https://github.com/OCA/reporting-engine.git,addons,,
+https://github.com/OCA/sale-workflow.git,addons,,
+https://github.com/OCA/server-auth.git,addons,,
+https://github.com/OCA/server-brand.git,addons,,
+https://github.com/OCA/server-env.git,addons,,
+https://github.com/OCA/server-tools.git,addons,,
+https://github.com/OCA/server-ux.git,addons,,
+https://github.com/OCA/social.git,addons,,
+https://github.com/OCA/stock-logistics-warehouse.git,addons,,
+https://github.com/OCA/timesheet.git,addons,,
+https://github.com/OCA/web.git,addons,,
+https://github.com/OCA/website.git,addons,,
+https://github.com/OCA/wms.git,addons,,
+https://github.com/odoo/odoo.git,.,12.0_feature_5_star_CRM,1
+https://github.com/odooaktiv/QuotationRevision.git,addons,,
+https://github.com/openeducat/openeducat_erp.git,addons,,
+https://github.com/SanteLibre/santelibre_addons.git,addons,master,
+https://github.com/Smile-SA/odoo_addons.git,addons,,
diff --git a/source_repo_addons_odoo.csv b/source_repo_addons_odoo.csv
deleted file mode 100644
index 0206b11..0000000
--- a/source_repo_addons_odoo.csv
+++ /dev/null
@@ -1,88 +0,0 @@
-url,path
-https://github.com/ERPLibre/erplibre_addons.git,addons
-https://github.com/MathBenTech/development.git,addons
-https://github.com/MathBenTech/odoo-business-spending-management-quebec-canada.git,addons
-https://github.com/MathBenTech/scrummer.git,addons
-https://github.com/muk-it/muk_base.git,addons
-https://github.com/muk-it/muk_dms.git,addons
-https://github.com/muk-it/muk_docs.git,addons
-https://github.com/muk-it/muk_misc.git,addons
-https://github.com/muk-it/muk_quality.git,addons
-https://github.com/muk-it/muk_web.git,addons
-https://github.com/muk-it/muk_website.git,addons
-https://github.com/Numigi/odoo-base-addons.git,addons
-https://github.com/Numigi/odoo-entertainment-addons.git,addons
-https://github.com/Numigi/odoo-git-addons.git,addons
-https://github.com/Numigi/odoo-hr-addons.git,addons
-https://github.com/Numigi/odoo-partner-addons.git,addons
-https://github.com/Numigi/odoo-product-addons.git,addons
-https://github.com/Numigi/odoo-project-addons.git,addons
-https://github.com/Numigi/odoo-purchase-addons.git,addons
-https://github.com/Numigi/odoo-stock-addons.git,addons
-https://github.com/Numigi/odoo-survey-addons.git,addons
-https://github.com/Numigi/odoo-timesheet-addons.git,addons
-https://github.com/Numigi/odoo-web-addons.git,addons
-https://github.com/OCA/account-analytic.git,addons
-https://github.com/OCA/account-budgeting.git,addons
-https://github.com/OCA/account-closing.git,addons
-https://github.com/OCA/account-consolidation.git,addons
-https://github.com/OCA/account-financial-reporting.git,addons
-https://github.com/OCA/account-financial-tools,addons
-https://github.com/OCA/account-fiscal-rule.git,addons
-https://github.com/OCA/account-invoicing.git,addons
-https://github.com/OCA/account-invoice-reporting.git,addons
-https://github.com/OCA/account-payment.git,addons
-https://github.com/OCA/account-reconcile.git,addons
-https://github.com/OCA/apps-store.git,addons
-https://github.com/OCA/bank-payment.git,addons
-https://github.com/OCA/bank-statement-import.git,addons
-https://github.com/OCA/brand.git,addons
-https://github.com/OCA/business-requirement.git,addons
-https://github.com/OCA/commission.git,addons
-https://github.com/OCA/community-data-files.git,addons
-https://github.com/OCA/connector-telephony.git,addons
-https://github.com/OCA/contract.git,addons
-https://github.com/OCA/credit-control.git,addons
-https://github.com/OCA/currency.git,addons
-https://github.com/OCA/data-protection.git,addons
-https://github.com/OCA/donation.git,addons
-https://github.com/OCA/e-commerce.git,addons
-https://github.com/OCA/edi.git,addons
-https://github.com/OCA/event.git,addons
-https://github.com/OCA/helpdesk.git,addons
-https://github.com/OCA/hr.git,addons
-https://github.com/OCA/knowledge.git,addons
-https://github.com/OCA/l10n-canada.git,addons
-https://github.com/OCA/maintenance.git,addons
-https://github.com/OCA/management-system.git,addons
-https://github.com/OCA/manufacture.git,addons
-https://github.com/OCA/margin-analysis.git,addons
-https://github.com/OCA/mis-builder.git,addons
-https://github.com/OCA/multi-company.git,addons
-https://github.com/OCA/partner-contact.git,addons
-https://github.com/OCA/pos.git,addons
-https://github.com/OCA/product-attribute.git,addons
-https://github.com/OCA/product-pack.git,addons
-https://github.com/OCA/product-variant.git,addons
-https://github.com/OCA/project.git,addons
-https://github.com/OCA/project-reporting.git,addons
-https://github.com/OCA/purchase-workflow.git,addons
-https://github.com/OCA/queue.git,addons
-https://github.com/OCA/reporting-engine.git,addons
-https://github.com/OCA/sale-workflow.git,addons
-https://github.com/OCA/server-auth.git,addons
-https://github.com/OCA/server-brand.git,addons
-https://github.com/OCA/server-env.git,addons
-https://github.com/OCA/server-tools.git,addons
-https://github.com/OCA/server-ux.git,addons
-https://github.com/OCA/social.git,addons
-https://github.com/OCA/stock-logistics-warehouse.git,addons
-https://github.com/OCA/timesheet.git,addons
-https://github.com/OCA/web.git,addons
-https://github.com/OCA/website.git,addons
-https://github.com/OCA/wms.git,addons
-https://github.com/odoo/odoo.git,.
-https://github.com/odooaktiv/QuotationRevision.git,addons
-https://github.com/openeducat/openeducat_erp.git,addons
-https://github.com/SanteLibre/santelibre_addons.git,addons
-https://github.com/Smile-SA/odoo_addons.git,addons