diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index 07114b1..0000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,7 +0,0 @@ -# ERPLibre - -## Move database prod to dev - -When moving database prod to your dev environment, you want to remove email servers, and install user test to test the database. -Run : -> -c config.conf --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE \ No newline at end of file diff --git a/HOWTO.md b/HOWTO.md deleted file mode 100644 index 3bf0c31..0000000 --- a/HOWTO.md +++ /dev/null @@ -1,4 +0,0 @@ -# How to clone me - -First, -pip install -r requirements.txt diff --git a/PRODUCTION.md b/PRODUCTION.md deleted file mode 100644 index 07114b1..0000000 --- a/PRODUCTION.md +++ /dev/null @@ -1,7 +0,0 @@ -# ERPLibre - -## Move database prod to dev - -When moving database prod to your dev environment, you want to remove email servers, and install user test to test the database. -Run : -> -c config.conf --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE \ No newline at end of file diff --git a/README.md b/README.md index 7c2ce9e..0ea50a9 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,17 @@ -# ERPLibre -https://railsware.com/blog/taming-the-git-daemon-to-quickly-share-git-repository/ -git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose +# ERPLibre documentation +Select a guide to install your environment! -repo init -u git://127.0.0.1:9418/ -b $(git branch --show-current) +## Discover guide +[Guide to run ERPLibre in discover to learn it](./doc/DISCOVER.md). -Table à vérifier dans pgsql : -ir_ui_view +## Production guide +[Guide to run ERPLibre in production server](./doc/PRODUCTION.md). -Restore une BD : -- un module est installé mais n'est pas physiquement là - -Une DB est installé mais on n'arrive pas à l'exécuté - - HEALTHCHECK CMD curl --fail http://localhost:8069/web || exit 1 - - TODO : having the DB variable configurable - - -## Installation procedure production - -##### 1. Clone the project: -``` -git clone https://github.com/ERPLibre/ERPLibre.git -``` -##### 2. Modify the parameters -Modify the file env_var.sh for production installation. - -##### 3. Execute the script: -``` -sudo ./script/odoo_install_production.sh -``` - -## Installation procedure locally - -##### 1. Clone the project: -``` -git clone https://github.com/ERPLibre/ERPLibre.git -``` - -##### 2. Execute the script: -``` -sudo ./script/odoo_install_locally.sh -``` +## Development guide +[Guide to run ERPLibre in development environment](./doc/DEVELOPMENT.md). # Execution -## First run -``` -source ./venv/bin/activate -python odoo/odoo-bin -c config.conf --log-level debug -``` +[Guide to run ERPLibre with different case](./doc/RUN.md). -## Update all -Great idea to run it when update Odoo, update database of each modules. -``` -python odoo/odoo-bin -c config.conf -d [DATABASE] -u all --log-level debug -``` - -## Update module -``` -python odoo/odoo-bin -c config.conf -d [DATABASE] -u [module] --log-level debug -``` - -## Test -``` -python odoo/odoo-bin -c config.conf -d [DATABASE] -i [module to test] --test-enable --stop-after-init --log-level=test --test-tags [module_name][tags] -``` - -# Production -``` -python odoo/odoo-bin -c config.conf -d [DATABASE] --no-database-list -``` - -# Thanks -Thanks Yenthe Van Ginneken for your guides. \ No newline at end of file +# git-repo +To change repository like addons, see [GIT_REPO.md](doc/GIT_REPO.md) diff --git a/doc/CONTRIBUTION.md b/doc/CONTRIBUTION.md new file mode 100644 index 0000000..c68c584 --- /dev/null +++ b/doc/CONTRIBUTION.md @@ -0,0 +1,16 @@ +# Thanks +## AGILE OPS +Thanks for contributing to GIT_REPO. +- [Agile OPS](https://www.linkedin.com/in/michaelfaille/) + +## MathBenTech +Thanks for creating this project. +- [MathBen.Tech](https://mathben.tech) + +## TechnoLibre +Thanks for making enterprise edition of ERPLibre. +- [TechnoLibre](https://technolibre.ca) + +## Yenthe Van Ginneken +Thanks Yenthe Van Ginneken for your scripting guides and tutorial. +- [Yenthe666 InstallScript](https://github.com/Yenthe666/InstallScript) diff --git a/doc/DEVELOPMENT.md b/doc/DEVELOPMENT.md new file mode 100644 index 0000000..2e45e18 --- /dev/null +++ b/doc/DEVELOPMENT.md @@ -0,0 +1,87 @@ +# Development guide +Setup your environment to develop modules and debug the platform. + +## Installation procedure locally +### 1. Clone the project: +```bash +git clone https://github.com/ERPLibre/ERPLibre.git +``` + +### 2. Execute the script: +```bash +cd ERPLibre +./script/install_dev.sh +./script/install_locally_dev.sh +``` + +### 3. Run ERPLibre +```bash +./run.sh +``` + +## Fork project to create a new project independent of ERPLibre (deprecated) +ERPLibre was created by this script. It's now deprecated. +Use this script when you need to fork directly from the original source. +Don't use this script if you want to update from ERPLibre and follow mainstream development. +```bash +./venv/bin/python ./script/fork_project.py --github_token GITHUB_KEY --organization NAME +``` + +# Fork all repo for you own organization +Go to your github account and generate a token to access fork option with your user. Create an organization (or you can choose your user name). + +This command will fork all repos and ERPLibre to your own organization. It keeps track to ERPLibre. +```bash +./venv/bin/python ./script/fork_project_ERPLibre.py --github_token GITHUB_KEY --organization NAME +``` + +## Generate manifest from csv repo +Add repo in file [./source_repo_addons.csv](./source_repo_addons.csv) + +Execute to generate manifest of Repo +```bash +./venv/bin/python ./script/fork_project_ERPLibre.py --skip_fork +``` + +## Move database prod to dev +When moving database prod to your dev environment, you want to remove email servers, and install user test in order to test the database. +Run: +```bash +./run.sh --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE +``` + +# TODO +```bash +./venv/bin/python ./script/git_change_remote.py +``` + +## Change git url https to git +This will update all urls in git format: +```bash +./venv/bin/python ./script/git_change_remote_https_to_git.py +``` + +## Diff repo with another project +Tools to display the differences between the repo and another project. +```bash +./venv/bin/python ./script/list_repo_diff.py --sync_to /path/to/project/erplibre --dyr_sync +``` + +## Sync repo with another project +Tools to synchronise the repo with another project. This will show differences and try to checkout on the same commit in all repo. +```bash +./venv/bin/python ./script/git_change_remote.py --sync_to /path/to/project/erplibre +``` + +## Add repo +Access to a new repo, add your URL to file [source_repo_addons.csv](../source_repo_addons.csv) + +Fork the repo to be able to push new code: +```bash +./venv/bin/python ./script/fork_project_ERPLibre.py +``` + +To regenerate only manifest.xml. +```bash +./venv/bin/python ./script/fork_project_ERPLibre.py --skip_fork +``` diff --git a/doc/DISCOVER.md b/doc/DISCOVER.md new file mode 100644 index 0000000..7a1fc0f --- /dev/null +++ b/doc/DISCOVER.md @@ -0,0 +1,31 @@ +# Discover +Explore the ERPLibre solution. + +## Fast installation +### 1. Clone the project: +```bash +git clone https://github.com/ERPLibre/ERPLibre.git +``` + +### 2. Run installation locally: +```bash +cd ERPLibre +./script/install_dev.sh +./script/install_locally_dev.sh +``` + +### 3. Run ERPLibre +```bash +./run.sh +``` + +## Add repo +Access to a new repo, add your URL to file [source_repo_addons.csv](../source_repo_addons.csv) + +Execute script: +```bash +./venv/bin/python ./script/git_repo_manifest.py +./script/install_locally_dev.sh +git commit -am "Add new repo" +``` +[Update your repo.](./GIT_REPO.md) diff --git a/doc/FAQ.md b/doc/FAQ.md new file mode 100644 index 0000000..d5a29cc --- /dev/null +++ b/doc/FAQ.md @@ -0,0 +1,21 @@ +# FAQ +## git-repo +### error.GitError fatal bad revision +Example: +``` +error.GitError: manifests rev-list (u'^2736dfd46e8a30cf59a9cd6e93d9e56e87021f2a', 'HEAD', '--'): fatal: bad revision 'HEAD' +``` + +Did you modify files in .repo? + +Anyways, to reset files from your branch into .repo: +```bash +cd .repo/manifests +git branch -av +> remotes/m/rel/8953/zd552kl/7.1.1-11.40.208 -> origin/rel/8953/zd552kl/7.1.1-11.40.208 +> remotes/origin/dev/ze550kl/asus/5.0.0-20150208 11a37fe set dev/ze550kl/asus/5.0.0-20150208 +> remotes/origin/rel/8953/zd552kl/7.1.1-11.40.208 2736dfd Remove opencv3 from the manifest +# To reset the "remotes/origin" use the same as "remotes/m" +git reset --hard REF_OF_REMOTES/m +> git reset --hard remotes/origin/rel/8953/zd552kl/7.1.1-11.40.208 +``` \ No newline at end of file diff --git a/doc/GIT_REPO.md b/doc/GIT_REPO.md new file mode 100644 index 0000000..a2608c1 --- /dev/null +++ b/doc/GIT_REPO.md @@ -0,0 +1,54 @@ +# git-repo +This is a guide to understand git-repo. Scripts in ERPLibre use git-repo automatically. + +[git-repo of Google](https://code.google.com/archive/p/git-repo) is used to manage all git repository under licence [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.html). + +## Setup repo +```bash +curl https://storage.googleapis.com/git-repo-downloads/repo > ./venv/repo +``` + +## prod +```bash +./venv/repo init -u http://git.erplibre.ca/ERPLibre -b 12.0_repo +./venv/repo sync +``` + +## dev +```bash +./venv/repo init -u http://git.erplibre.ca/ERPLibre -b 12.0_repo -m ./manifest/default.dev.xml +./venv/repo sync +``` + +## dev locally +[Guide to setup locally git](https://railsware.com/blog/taming-the-git-daemon-to-quickly-share-git-repository/). +```bash +git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose & + +./venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --abbrev-ref HEAD) -m ./manifest/default.dev.xml +./venv/repo sync -m ./manifest/default.dev.xml +``` + +# Create Manifest +A [Manifest](https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md), is a XML file managed by git-repo to generate repo. + +## Make a new version of prod +Freezes all repo, from dev to prod. + +This will add revision git hash in the Manifest. +```bash +./venv/repo manifest -r -o ./manifest/default.xml +``` +Do your commit. +```bash +git commit -am "[#ticket] subject: short sentence" +``` + +## Create a dev version +```bash +./venv/repo manifest -o ./manifest/default.dev.xml +``` +Do your commit. +```bash +git commit -am "[#ticket] subject: short sentence" +``` \ No newline at end of file diff --git a/doc/HOWTO.md b/doc/HOWTO.md new file mode 100644 index 0000000..b337e76 --- /dev/null +++ b/doc/HOWTO.md @@ -0,0 +1,3 @@ +# HOW TO +## Update changelog +Please, read documentation (keepachangelog.com)[https://keepachangelog.com] \ No newline at end of file diff --git a/MIGRATION.md b/doc/MIGRATION.md similarity index 98% rename from MIGRATION.md rename to doc/MIGRATION.md index 4dcfab3..77298e9 100644 --- a/MIGRATION.md +++ b/doc/MIGRATION.md @@ -6,7 +6,7 @@ TODO ## Migration procedure dev -Example : +Example: update module helpdesk_mgmt and helpdesk_join_team diff --git a/doc/PRODUCTION.md b/doc/PRODUCTION.md new file mode 100644 index 0000000..880dfc3 --- /dev/null +++ b/doc/PRODUCTION.md @@ -0,0 +1,32 @@ +# ERPLibre production guide + +## Installation procedure production + +### 1. Clone the project: +```bash +git clone https://git.erplibre.ca/ERPLibre.git +``` + +### 2. Modify the parameters +Modify the file env_var.sh for production installation. + +### 3. Execute the script: +```bash +cd ERPLibre +./script/install_dev.sh +./script/install_production.sh +``` + +## Production execution +```bash +cd /[EL_USER]/erplibre +./run.sh -d [DATABASE] --no-database-list +``` + +## Move database prod to dev + +When moving database prod to your dev environment, you want to remove email servers, and install user test to test the database. +Run: +```bash +./run.sh --stop-after-init -i user_test,disable_mail_server --dev all -d DATABASE +``` diff --git a/doc/RELEASE.md b/doc/RELEASE.md new file mode 100644 index 0000000..9e21f25 --- /dev/null +++ b/doc/RELEASE.md @@ -0,0 +1,21 @@ +# Release +A guide on how to do a release. + +## Generate new prod +```bash +./venv/repo manifest -r -o ./manifest/default.xml +``` +Do your commit. +```bash +git commit -am "[#ticket] subject: short sentence" +``` + +## Merge release +Merge your feature to master. Generate a new tag. Fill CHANGELOG.md + +# TIPS +## Compare diff repo with another ERPLibre project +To generate a list of differences between repo git commit, do +```bash +./venv/bin/python ./script/git_change_remote.py --sync_to /path/to/directory +``` \ No newline at end of file diff --git a/doc/RUN.md b/doc/RUN.md new file mode 100644 index 0000000..c1e1d0b --- /dev/null +++ b/doc/RUN.md @@ -0,0 +1,41 @@ +# Execute ERPLibre + +## Start database +```bash +sudo systemctl start postgresql.service +``` + +## Run ERPLibre +### Method 1 +Simply +```bash +./run.sh +``` + +With arguments +```bash +./run.sh -h +``` + +### Method 2 +Execute your own python script: +```bash +source ./venv/bin/activate +python odoo/odoo-bin -c config.conf --log-level debug +``` + +### Update all +Great idea to run it when updating Odoo, it updates database of each modules. +```bash +python odoo/odoo-bin -c config.conf -d [DATABASE] -u all --log-level debug +``` + +### Update module +```bash +python odoo/odoo-bin -c config.conf -d [DATABASE] -u [module] --log-level debug +``` + +### Test +```bash +python odoo/odoo-bin -c config.conf -d [DATABASE] -i [module to test] --test-enable --stop-after-init --log-level=test --test-tags [module_name][tags] +``` \ No newline at end of file diff --git a/doc/TODO.md b/doc/TODO.md new file mode 100644 index 0000000..5650e49 --- /dev/null +++ b/doc/TODO.md @@ -0,0 +1,11 @@ +# Note healtcheck +Table à vérifier dans pgsql: ir_ui_view + +Restore une BD: +- un module est installé mais n'est pas physiquement là + +Une DB est installé mais on n'arrive pas à l'exécuté + + HEALTHCHECK CMD curl --fail http://localhost:8069/web || exit 1 + + TODO: having the DB variable configurable \ No newline at end of file diff --git a/run.md b/run.md deleted file mode 100644 index ba722dc..0000000 --- a/run.md +++ /dev/null @@ -1,5 +0,0 @@ -== Start database == -sudo systemctl start postgresql.service - -== Run Odoo == -./venv/bin/python ./odoo/odoo-bin -c config.conf