erplibre/doc/RELEASE.md

209 lines
4.4 KiB
Markdown
Raw Permalink Normal View History

# Release
2020-12-11 03:46:56 -05:00
A guide on how to generate a release.
## Clean environment before generating new release
2020-12-11 03:46:56 -05:00
Before the cleaning, check if existing file isn't committed, not pushed or in stash.
2021-07-20 00:31:15 -04:00
```bash
.venv.erplibre/bin/repo forall -pc "git stash list"
./script/git/git_show_code_diff_repo_manifest.py
```
This will erase everything in addons. Useful before creating docker, manifest and do a release.
2020-12-11 03:46:56 -05:00
```bash
./script/git/clean_repo_manifest.sh
2020-12-11 03:46:56 -05:00
```
And update all from dev to merge into prod.
2025-04-13 04:08:57 -04:00
Test all supported Odoo version :
2020-12-11 03:46:56 -05:00
```bash
2025-04-13 04:08:57 -04:00
make install_odoo_all_version
2020-12-11 03:46:56 -05:00
```
2021-07-20 00:31:15 -04:00
## Validate environment
2025-04-13 04:08:57 -04:00
- Check if each manifest version like [manifest/default.dev.odoo16.0.xml](../manifest/default.dev.odoo16.0.xml) is ready for production.
- Run test :
```bash
make test_full_fast
```
2021-07-20 00:31:15 -04:00
### Format code
To format all code, run:
```bash
make format
```
2021-07-20 16:39:57 -04:00
### Update documentations
To generate Markdown in directory `./doc`, run:
```bash
make doc_markdown
```
2021-07-20 00:31:15 -04:00
### Test docker generate
To generate a docker, run:
```bash
2026-02-16 10:30:53 -05:00
make docker_build_odoo_18
```
### Rename old version to new version
Search old version, like :
2022-03-03 14:35:23 -05:00
```bash
2025-04-13 12:50:14 -04:00
grep --color=always --exclude-dir={.repo,.venv,.git} --exclude="*.svg" -nri v1.6.0
```
Replace if need it to new version.
Update file `./pyproject.toml` in [tool.poetry], line `version =`.
### Test production Ubuntu environment
Follow instructions in [PRODUCTION.md](./PRODUCTION.md).
Test installation with code generator Geomap:
```bash
make addons_install_code_generator_full
```
### Update image_db
To generate database images in directory `./image_db`, run:
```bash
make db_clean_cache
make config_gen_all
2023-07-07 02:35:46 -04:00
make image_db_create_all_parallel
```
To test it, you need to clean caches and install it:
```bash
./script/database/db_restore.py --clean_cache
./script/database/db_restore.py --database test --image erplibre_website
```
2020-12-11 03:46:56 -05:00
## Generate new prod and release
Generate production manifest and freeze all repos versions.
```bash
.venv.erplibre/bin/repo manifest -r -o ./default.xml
```
2020-12-11 03:46:56 -05:00
2022-03-03 14:35:23 -05:00
Update ERPLIBRE_VERSION variable in [env_var.sh](../env_var.sh), [Dockerfile.prod](../docker/Dockerfile.prod.pkg)
and [docker-compose](../docker-compose.yml).
2020-12-11 03:46:56 -05:00
Generate [poetry](./POETRY.md) and keep only missing dependencies, remove updates.
2021-07-20 00:31:15 -04:00
```bash
./script/poetry/poetry_update.py
```
When running script ./script/poetry/poetry_update.py, note manually inserted dependencies, stash all changes and add it
manually.
2021-07-20 00:31:15 -04:00
2020-12-11 03:46:56 -05:00
```bash
poetry add DEPENDENCY
```
2020-09-29 19:37:21 -04:00
2020-12-11 03:46:56 -05:00
Understand differences from last release:
2020-09-29 19:37:21 -04:00
2020-12-11 03:46:56 -05:00
```bash
# Get all differences between the last tag and HEAD, to update the CHANGELOG.md
# ERPLibre
git diff v#.#.#..HEAD
# All repo
.venv.erplibre/bin/repo forall -pc "git diff ERPLibre/v#.#.#..HEAD"
2020-12-11 03:46:56 -05:00
```
Simplification tools:
2021-07-20 00:31:15 -04:00
```bash
# Show all divergence repository with production
make repo_diff_manifest_production
2022-01-24 23:38:34 -05:00
# Short version with statistics
make repo_diff_stat_from_last_version
# Long version
make repo_diff_from_last_version
```
2020-12-11 03:46:56 -05:00
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**.
```bash
git checkout master
git merge --no-ff RELEASE_BRANCH
```
Add comment `Release v#.#.#`.
2020-12-11 03:46:56 -05:00
## Create tag
Add a tag on the commit in branch master with your release. When adding tag, be sure to update default.xml
2020-12-11 03:46:56 -05:00
```bash
git tag v#.#.#
# Push your tags
git push --tags
# Add tags for all repo
.venv.erplibre/bin/repo forall -pc "git tag ERPLibre/v#.#.#"
make tag_push_all
```
2020-12-11 03:46:56 -05:00
## Generate and push docker
Important to generate container after push git tags, otherwise the git version will be wrong.
2020-11-20 23:54:44 -05:00
When building your docker with script
> make docker_build_release
2020-11-20 23:54:44 -05:00
List your docker version
2020-12-12 01:15:23 -05:00
> docker images
2020-11-20 23:54:44 -05:00
You need to push your docker image and update your tag, like 1.0.1:
> docker push technolibre/erplibre:VERSION
2020-10-03 01:36:29 -04:00
## Do a release on github
2022-03-03 14:35:23 -05:00
Visit `https://github.com/ERPLibre/ERPLibre/releases/new` and create a release named `v#.#.#` and copy information from
CHANGELOG.md.
# TIPS
2020-12-11 03:46:56 -05:00
## Compare repo differences with another ERPLibre project
2020-12-11 03:46:56 -05:00
To generate a list of differences between repo git commit
```bash
./script/git/git_change_remote.py --sync_to /path/to/directory
```
## Semantic versioning
```
<valid semver> ::= <version core> "-" <pre-release> "+" <build>
```