Build system based on sorting binding tasks according to their dependencies.
Preconditions:
- Python must be installed
- Docker daemon must be running
- Clone the repository: git clone https://github.com/valeriyaduran/build-system.git
- Launch the service: from the project working directory enter the following command in the terminal: 'docker compose up' or 'sudo docker compose up' (depending on permissions)
Builds and tasks are stored in "builds" directory.
To get a list of tasks by build name, sorted based on their dependencies, you need to send a POST request containing the build name.
Request example:
curl --location 'http://0.0.0.0:8080/get_tasks' \
--header 'API-Key: <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{"build": "front_arm"}'
Response example:
["build_lime_golems", "map_gray_goblins", "design_olive_goblins", "build_teal_goblins", "build_silver_goblins", "create_lime_goblins", "write_teal_witches", "enable_white_golems", "coloring_silver_golems", "train_maroon_golems", "upgrade_aqua_centaurs", "map_fuchsia_centaurs", "read_lime_centaurs", "create_blue_centaurs", "bring_purple_humans", "write_yellow_humans", "read_maroon_humans", "design_blue_humans", "write_gray_humans", "train_fuchsia_orcs", "design_maroon_golems", "write_navy_golems", "design_yellow_golems", "read_white_leprechauns", "coloring_fuchsia_leprechauns", "write_maroon_humans", "upgrade_black_humans", "create_green_humans", "upgrade_silver_humans", "map_yellow_humans", "coloring_black_goblins", "design_maroon_witches", "design_teal_golems", "design_yellow_centaurs", "map_purple_humans", "read_aqua_orcs", "read_gray_golems", "train_white_leprechauns", "upgrade_gray_humans"]
Note: API_KEY stored in .env (you can check .env.example)
Tests are stored in "tests" directory.
Tests are implemented for TaskManager and TaskSorting classes as well as on the app API.
To run tests enter the following command in the terminal of 'build-system-fastapi' container:
export PYTHONPATH=. && pytest
To check test coverage enter the following command in the terminal of 'build-system-fastapi' container:
coverage run -m pytest
and to see the report:
coverage report -m
![Screenshot 2023-12-21 at 10 34 22](https://private-user-images.githubusercontent.com/36791323/292129651-1b40fad6-1766-416c-91e8-de1993b5292a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTg1Nzc5OTIsIm5iZiI6MTcxODU3NzY5MiwicGF0aCI6Ii8zNjc5MTMyMy8yOTIxMjk2NTEtMWI0MGZhZDYtMTc2Ni00MTZjLTkxZTgtZGUxOTkzYjUyOTJhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjE2VDIyNDEzMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZhOWI5MmE4MjM3NjM2ZjBmYjZlZjMwYjFhNDMxYTgwN2M4ZDMzMjhiN2VlNDAyMDNjZGJlZDZiOTM5ZjU4MDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.l5PQ7CH-UIylIon45lIlfUHk4RIyTd1h4eq0n7iH3G8)
To check the code for stylistic errors and standards violations enter the following command from the project’s working directory in the terminal:
flake8 .
- python 3.10.7
- fastapi
- pyyaml
- docker
- pytest
- coverage
- flake8
- pipenv