[UPD] doc improve release HOW TO

This commit is contained in:
Mathieu Benoit 2020-12-11 03:46:56 -05:00
parent 2b576440d6
commit 08554315c9
3 changed files with 68 additions and 12 deletions

View file

@ -114,3 +114,9 @@ python odoo/odoo-bin scaffold MODULE_NAME addons/REPO_NAME/
```bash ```bash
/script/pull_request_ERPLibre.py --github_token ### --organization ERPLibre /script/pull_request_ERPLibre.py --github_token ### --organization ERPLibre
``` ```
# Commit
Use this commit format:
```bash
git commit -am "[#ticket] subject: short sentence"
```

View file

@ -6,6 +6,8 @@ Add your dependencies in file [requirements.txt](../requirements.txt) and run sc
``` ```
This will search all `requirements.txt` files and update `pyproject.toml` and it will update poetry This will search all `requirements.txt` files and update `pyproject.toml` and it will update poetry
TODO add option to only add missing dependencies and ignore update.
## Add manually dependencies ## Add manually dependencies
The automatic script will erase this dependency, but you can add it for your local test. The automatic script will erase this dependency, but you can add it for your local test.
```bash ```bash

View file

@ -1,24 +1,68 @@
# Release # Release
A guide on how to generate a release. A guide on how to generate a release.
## Generate new prod Before starting, validate [manifest/default.dev.xml](../manifest/default.dev.xml) is ready for production.
## Clean environment before generate new release
Be sure all files are commit and push, this will erase everything in addons.
```bash
./script/clean_repo_manifest.sh
```
And update all from dev to merge into prod.
```bash
./script/install_locally_dev.sh
```
## Generate new prod and release
Generate production manifest and freeze all repos versions.
```bash ```bash
./.venv/repo manifest -r -o ./default.xml ./.venv/repo manifest -r -o ./default.xml
``` ```
Commit.
Update ERPLIBRE_VERSION variable in [env_var.sh](../env_var.sh) and [Dockerfile.prod](../docker/Dockerfile.prod.pkg).
Generate [poetry](./POETRY.md) and keep only missing dependencies, remove updates.
```bash ```bash
git commit -am "[#ticket] subject: short sentence" ./script/poetry_update.py
``` ```
Update ERPLIBRE_VERSION variable in [env_var.sh](../env_var.sh) When running script poetry_update.py, note manually inserted dependencies, stash all changes and add it manually.
```bash
poetry add DEPENDENCY
```
## Merge release Understand differences from last release:
When you are ready to generate a release, create a branch release/#.#.# and create a pull request to master.
Update file [CHANGELOG.md](../CHANGELOG.md) and create a section with new version. ```bash
Merge it when the maintainer accepts it. # Get all differences between the last tag and HEAD, to update the CHANGELOG.md
# ERPLibre
git diff v#.#.#..HEAD
# All repo
./.venv/repo forall -pc "git diff ERPLibre/v#.#.#..HEAD"
```
Update file [CHANGELOG.md](../CHANGELOG.md) and create a section with new version, use next command to read all changes.
Create a branch release/#.#.# and create a pull request to branch master with your commit:
```bash
git commit -am "Release v#.#.#"
```
Review by your peers, test the docker file and merge to master.
## Create tag
Add a tag on the commit in branch master with your release. When adding tag, be sure to update default.xml Add a tag on the commit in branch master with your release. When adding tag, be sure to update default.xml
```bash ```bash
git tag v#.#.# git tag v#.#.#
# Push your tags # Push your tags
@ -26,11 +70,12 @@ git push --tags
# Add tags for all repo # Add tags for all repo
./.venv/repo forall -pc "git tag ERPLibre/v#.#.#" ./.venv/repo forall -pc "git tag ERPLibre/v#.#.#"
./.venv/repo forall -pc "git push ERPLibre --tags" ./.venv/repo forall -pc "git push ERPLibre --tags"
# Get all difference between a tag and HEAD, to update the CHANGELOG.md
./.venv/repo forall -pc "git diff ERPLibre/v#.#.#..HEAD"
``` ```
## Push docker ## Generate and push docker
Important to generate container after push git tags, otherwise the git version will be wrong.
When building your docker with script When building your docker with script
> ./script/docker_build.sh --release > ./script/docker_build.sh --release
@ -41,8 +86,11 @@ You need to push your docker image and update your tag, like 1.0.1:
> docker push technolibre/erplibre:VERSION > docker push technolibre/erplibre:VERSION
# TIPS # TIPS
## Compare repo differences with another ERPLibre project ## Compare repo differences with another ERPLibre project
To generate a list of differences between repo git commit
To generate a list of differences between repo git commit
```bash ```bash
./script/git_change_remote.py --sync_to /path/to/directory ./script/git_change_remote.py --sync_to /path/to/directory
``` ```