Skip to content

Latest commit

 

History

History
65 lines (44 loc) · 2.94 KB

CONTRIBUTING.md

File metadata and controls

65 lines (44 loc) · 2.94 KB

Contributing

All the contributions are welcome in Modulector project, please reads all the considerations. If you want to make a production deploy please read the DEPLOYING.md document.

The entire contributing process consists in the following steps:

  1. Fork the repository.
  2. Make a new branch.
  3. Make your changes in that branch and push to your fork version.
  4. Make a Pull Request in Github from your fork's branch to our master branch in the official repository.
  5. That's all!

Requirements

  1. The entire deploy was configured to be simple from the tool Docker Compose. So you need to install:

Pre-requisites

  • Python 3.8+

Installation

  1. Create a Python's virtualenv to install the dependencies. In the project's root folder:
    1. python3 -m venv venv
    2. source venv/bin/activate (this command must be run every time you want to start the Django server, otherwise we won't have the dependencies available)
    3. pip install -r config/requirements.txt
  2. Fill the DB. Follow the instructions in the DEPLOYING document.
    1. (Optional) create a super-user to work with the Django admin panel:
      1. python3 manage.py makemigrations
      2. python3 manage.py migrate
      3. python3 manage.py createsuperuser (now you can access to <URL:port>/admin)

Developing

  1. Start up the DB (PostgreSQL) service running: docker compose -f docker-compose.dev.yml up -d
    • This will start the DBMS service and an Adminer instance in the URL http://127.0.0.1:8080 where you can enter the db and see its structure.
    • To stop all the service just run docker compose -f docker-compose.dev.yml down
  2. Start Django's development server:
    1. In the project's root folder and with the virtualenv active, run: python3 manage.py runserver. The site will be available in http://127.0.0.1:8000/.

Workflow

We use gitlab environment git workflow. The default branch is dev and the publishing branch is main. The working branches are created from dev and must respect the following steps and actions:

  1. A new branch is created from dev.
  2. After finish working with it, a PR to dev must be created.
  3. Automatic Action/Workflow for PR is executed.
  4. The new branch is merged to dev.
  5. Automatic Action/Workflow for Push events into dev is executed.
  6. When is ready to publish a new version of dev, a PR to main is created.
  7. These Action/Workflow are executed:
    1. PR.
    2. Version checker (to avoid overwrite an existing image on Docker Hub repository).
  8. dev is merged into main.
  9. Automatic Action/Workflow for Push events into main is executed to build a new Docker image for Modulector and publish it.

More information