2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-16 17:19:03 +00:00
frappe_docker/CONTRIBUTING.md

82 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

# Contribution Guidelines
2022-03-24 07:42:00 +00:00
Before publishing a PR, please test builds locally.
2021-12-02 23:36:58 +00:00
On each PR that contains changes relevant to Docker builds, images are being built and tested in our CI (GitHub Actions).
2021-12-10 08:53:43 +00:00
> :evergreen_tree: Please be considerate when pushing commits and opening PR for multiple branches, as the process of building images uses energy and contributes to global warming.
2021-12-02 23:36:58 +00:00
## Lint
We use `pre-commit` framework to lint the codebase before committing.
First, you need to install pre-commit with pip:
```shell
pip install pre-commit
```
Also you can use brew if you're on Mac:
2021-12-02 23:36:58 +00:00
```shell
brew install pre-commit
2021-12-02 23:36:58 +00:00
```
To setup _pre-commit_ hook, run:
```shell
pre-commit install
```
To run all the files in repository, run:
```shell
pre-commit run --all-files
```
2021-12-02 23:36:58 +00:00
## Build
2022-03-24 07:42:00 +00:00
We use [Docker Buildx Bake](https://docs.docker.com/engine/reference/commandline/buildx_bake/). To build the images, run command below:
2021-12-02 23:36:58 +00:00
```shell
2022-03-24 07:42:00 +00:00
FRAPPE_VERSION=... ERPNEXT_VERSION=... docker buildx bake <targets>
2021-12-02 23:36:58 +00:00
```
2022-03-24 07:42:00 +00:00
Available targets can be found in `docker-bake.hcl`.
2022-03-24 07:42:00 +00:00
## Test
2021-12-10 08:53:43 +00:00
2022-03-24 07:42:00 +00:00
We use [pytest](https://pytest.org) for our integration tests.
2022-03-24 07:42:00 +00:00
Install Python test requirements:
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
```shell
2022-03-24 07:42:00 +00:00
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-test.txt
2021-12-02 23:36:58 +00:00
```
2022-03-24 07:42:00 +00:00
Run pytest:
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
```shell
2022-03-24 07:42:00 +00:00
pytest
2021-12-02 23:36:58 +00:00
```
# Documentation
2022-03-24 07:42:00 +00:00
Place relevant markdown files in the `docs` directory and index them in README.md located at the root of repo.
2021-12-02 23:36:58 +00:00
# Frappe and ERPNext updates
2021-06-24 11:24:17 +00:00
2021-12-02 23:36:58 +00:00
Each Frappe/ERPNext release triggers new stable images builds as well as bump to helm chart.
# Maintenance
In case of new release of Debian. e.g. bullseye to bookworm. Change following files:
- `images/erpnext/Containerfile` and `images/custom/Containerfile`: Change the files to use new debian release, make sure new python version tag that is available on new debian release image. e.g. 3.9.9 (bullseye) to 3.9.17 (bookworm) or 3.10.5 (bullseye) to 3.10.12 (bookworm). Make sure apt-get packages and wkhtmltopdf version are also upgraded accordingly.
- `images/bench/Dockerfile`: Change the files to use new debian release. Make sure apt-get packages and wkhtmltopdf version are also upgraded accordingly.
Change following files on release of ERPNext
- `.github/workflows/build_stable.yml`: Add the new release step under `jobs` and remove the unmaintained one. e.g. In case v12, v13 available, v14 will be added and v12 will be removed on release of v14. Also change the `needs:` for later steps to `v14` from `v13`.