erplibre/doc/RELEASE.md

3.2 KiB

Release

A guide on how to generate a release.

Clean environment before generate new release

Before clean, check if existing file not committed, not pushed or in stash.

./.venv/repo forall -pc "git stash list"
./script/git_show_code_diff_repo_manifest.py

This will erase everything in addons. Useful before create docker, manifest and do a release.

./script/clean_repo_manifest.sh

And update all from dev to merge into prod.

./script/install_locally_dev.sh

Validate environment

Update image_db

Run make image_db_create_all, this will generate image in directory ./image_db.

Test docker generate

Run make docker_build to generate a docker.

Generate new prod and release

Generate production manifest and freeze all repos versions.

./.venv/repo manifest -r -o ./default.xml

Update ERPLIBRE_VERSION variable in env_var.sh and Dockerfile.prod.

Generate poetry and keep only missing dependencies, remove updates.

./script/poetry_update.py

When running script poetry_update.py, note manually inserted dependencies, stash all changes and add it manually.

poetry add DEPENDENCY

Understand differences from last release:

# 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"

Simplification tools:

# Show all divergence repository with production
make repo_diff_manifest_production
# Short version with statistique
make repo_diff_stat_from_last_version
# Long version
make repo_diff_from_last_version

Update file 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:

git commit -am "Release v#.#.#"

Review by your peers, test the docker file and merge to master.

Generate image db to accelerate db installation

Generate image db before tag, the image is store in directory ./image_db

make image_db_create_all

To test it, you need to clean caches and install it:

./script/db_restore.py --clean_cache
./script/db_restore.py --database test --image erplibre_website

Create tag

Add a tag on the commit in branch master with your release. When adding tag, be sure to update default.xml

git tag v#.#.#
# Push your tags
git push --tags
# Add tags for all repo
./.venv/repo forall -pc "git tag ERPLibre/v#.#.#"
make tag_push_all

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

make docker_build_release

List your docker version

docker images

You need to push your docker image and update your tag, like 1.0.1:

docker push technolibre/erplibre:VERSION

TIPS

Compare repo differences with another ERPLibre project

To generate a list of differences between repo git commit

./script/git_change_remote.py --sync_to /path/to/directory