2020-03-24 15:00:46 +00:00
# Contribution Guidelines
2020-06-13 10:03:06 +00:00
2021-12-02 23:36:58 +00:00
Before publishing a PR, please test builds locally:
2020-03-24 15:00:46 +00:00
2021-12-02 23:36:58 +00:00
- with docker-compose for production,
- with and without nginx proxy,
- with VSCode for testing environments (only for frappe/bench image).
2020-03-24 15:00:46 +00:00
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).
2020-03-24 15:00:46 +00:00
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-10 08:48:00 +00:00
2021-12-02 23:36:58 +00:00
## Lint
2020-03-24 15:00:46 +00:00
2021-12-10 08:48:00 +00:00
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
2021-12-10 08:48:00 +00:00
brew install pre-commit
2021-12-02 23:36:58 +00:00
```
2020-03-24 15:00:46 +00:00
2021-12-10 08:48:00 +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
2020-06-13 10:03:06 +00:00
2021-12-02 23:36:58 +00:00
```shell
# *...* — targets from docker-bake.hcl,
# e.g. bench-build, frappe-socketio-develop or erpnext-nginx-stable.
# Stable builds require GIT_BRANCH (e.g. v13.15.0), IMAGE_TAG (version-13), VERSION (13)
# environment variables set.
docker buildx bake -f docker-bake.hcl *...*
```
2020-06-13 10:03:06 +00:00
2021-12-02 23:36:58 +00:00
## Test
2020-06-13 10:03:06 +00:00
2021-12-02 23:36:58 +00:00
### Ping site
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
Lightweight test that just checks if site will be available after creation.
2020-06-13 10:03:06 +00:00
2021-12-02 23:36:58 +00:00
Frappe:
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
```shell
./tests/test-frappe.sh
```
2020-03-24 15:00:46 +00:00
2021-12-02 23:36:58 +00:00
ERPNext:
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
```shell
./tests/test-erpnext.sh
```
2020-03-24 15:00:46 +00:00
2021-12-02 23:36:58 +00:00
### Integration test
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
Tests frappe-bench-like commands, for example, `backup` and `restore` .
2021-12-10 08:53:43 +00:00
2021-12-02 23:36:58 +00:00
```shell
./tests/integration-test.sh
```
2020-03-24 15:00:46 +00:00
2020-06-13 10:03:06 +00:00
# Documentation
2020-03-24 15:00:46 +00:00
2020-06-13 10:03:06 +00:00
Place relevant markdown file(s) in the `docs` directory and index them in README.md located at the root of repo.
2021-02-25 09:59:54 +00:00
# Wiki
Add alternatives that can be used optionally along with frappe_docker. Add articles to list on home page as well.
2021-06-24 11:24:17 +00:00
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.