Skip to content

Commit cae7f01

Browse files
authored
Merge pull request #309 from minos-framework/283-create-rabbitmq-plugin
#283 - Create RabbitMQ plugin
2 parents 7727757 + 5e72a2c commit cae7f01

38 files changed

+1183
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "Publish: minos-broker-rabbitmq"
2+
3+
on:
4+
push:
5+
branches:
6+
- '*.*.x'
7+
paths:
8+
- 'packages/plugins/minos-broker-rabbitmq/**'
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
13+
container: python:3.9-buster
14+
defaults:
15+
run:
16+
working-directory: packages/plugins/minos-broker-rabbitmq
17+
18+
steps:
19+
20+
- name: Check out repository code
21+
uses: actions/checkout@v2
22+
23+
- name: Install Poetry
24+
uses: snok/install-poetry@v1
25+
26+
- name: Install dependencies
27+
run: make install
28+
29+
- name: Publish package
30+
run: make release
31+
env:
32+
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
33+
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "Test: minos-broker-rabbitmq"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- '*.*.x'
8+
pull_request:
9+
paths:
10+
- 'packages/plugins/minos-broker-rabbitmq/**'
11+
- 'packages/core/minos-microservice-networks/**'
12+
- 'packages/core/minos-microservice-common/**'
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
container: python:3.9-buster
18+
defaults:
19+
run:
20+
working-directory: packages/plugins/minos-broker-rabbitmq
21+
22+
services:
23+
postgres:
24+
image: postgres
25+
env:
26+
POSTGRES_USER: minos
27+
POSTGRES_PASSWORD: min0s
28+
POSTGRES_DB: order_db
29+
ports:
30+
- 5432:5432
31+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
32+
33+
rabbitmq:
34+
image: rabbitmq:3
35+
ports:
36+
- "5672:5672"
37+
38+
env:
39+
MINOS_BROKER_QUEUE_HOST: postgres
40+
MINOS_BROKER_HOST: rabbitmq
41+
MINOS_REPOSITORY_HOST: postgres
42+
MINOS_SNAPSHOT_HOST: postgres
43+
44+
steps:
45+
- name: Check out repository code
46+
uses: actions/checkout@v2
47+
48+
- name: Install Poetry
49+
uses: snok/install-poetry@v1
50+
51+
- name: Install dependencies
52+
run: make install
53+
54+
- name: Lint package
55+
run: make lint
56+
57+
- name: Test package with coverage
58+
run: make coverage
59+
60+
- name: Publish coverage
61+
uses: codecov/codecov-action@v2
62+
with:
63+
token: ${{ secrets.CODECOV_TOKEN }}
64+
files: ./packages/plugins/minos-broker-rabbitmq/coverage.xml
65+
fail_ci_if_error: true
66+
67+
- name: Generate documentation
68+
run: make docs
69+
70+
- name: Generate build
71+
run: make dist

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,10 @@ repos:
6464
name: Check minos-router-graphql
6565
files: ^packages/plugins/minos-router-graphql/
6666
language: system
67+
68+
- id: minos-broker-rabbitmq-check
69+
pass_filenames: false
70+
entry: make --directory=packages/plugins/minos-broker-rabbitmq check
71+
name: Check minos-broker-rabbitmq
72+
files: ^packages/plugins/minos-broker-rabbitmq/
73+
language: system
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Credits
2+
3+
## Development Lead
4+
5+
* Andrea Mucci <[email protected]>
6+
7+
## Core Devs
8+
9+
* Sergio Garcia Prado <[email protected]>
10+
* Vladyslav Fenchak <[email protected]>
11+
* Alberto Amigo Alonso <[email protected]>
12+
13+
## Contributors
14+
15+
None yet. Why not be the first?
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# History
2+
3+
## 0.6.0 (2022-03-25)
4+
5+
* Created RabbitMQ plugin.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Clariteia
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.PHONY: docs
2+
3+
lint:
4+
poetry run flake8
5+
6+
test:
7+
poetry run pytest
8+
9+
coverage:
10+
poetry run coverage run -m pytest
11+
poetry run coverage report -m
12+
poetry run coverage xml
13+
14+
reformat:
15+
poetry run black --line-length 120 minos tests
16+
poetry run isort minos tests
17+
18+
docs:
19+
rm -rf docs/api
20+
poetry run $(MAKE) --directory=docs html
21+
22+
release:
23+
$(MAKE) dist
24+
poetry publish
25+
26+
dist:
27+
poetry build
28+
ls -l dist
29+
30+
install:
31+
poetry install
32+
33+
update:
34+
poetry update
35+
36+
check:
37+
$(MAKE) install
38+
$(MAKE) reformat
39+
$(MAKE) lint
40+
$(MAKE) test
41+
$(MAKE) docs
42+
$(MAKE) dist
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<p align="center">
2+
<a href="http://minos.run" target="_blank"><img src="https://raw.githubusercontent.com/minos-framework/.github/main/images/logo.png" alt="Minos logo"></a>
3+
</p>
4+
5+
## minos-broker-rabbitmq
6+
7+
[![PyPI Latest Release](https://img.shields.io/pypi/v/minos-broker-rabbitmq.svg)](https://pypi.org/project/minos-broker-rabbitmq/)
8+
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/minos-framework/minos-python/pages%20build%20and%20deployment?label=docs)](https://minos-framework.github.io/minos-python)
9+
[![License](https://img.shields.io/github/license/minos-framework/minos-python.svg)](https://github.com/minos-framework/minos-python/blob/main/LICENSE)
10+
[![Coverage](https://codecov.io/github/minos-framework/minos-python/coverage.svg?branch=main)](https://codecov.io/gh/minos-framework/minos-python)
11+
[![Stack Overflow](https://img.shields.io/badge/Stack%20Overflow-Ask%20a%20question-green)](https://stackoverflow.com/questions/tagged/minos)
12+
13+
## Summary
14+
15+
Minos is a framework which helps you create [reactive](https://www.reactivemanifesto.org/) microservices in Python.
16+
Internally, it leverages Event Sourcing, CQRS and a message driven architecture to fulfil the commitments of an
17+
asynchronous environment.
18+
19+
## Documentation
20+
21+
The official API Reference is publicly available at the [GitHub Pages](https://minos-framework.github.io/minos-python).
22+
23+
## Source Code
24+
25+
The source code of this project is hosted at the [GitHub Repository](https://github.com/minos-framework/minos-python).
26+
27+
## Getting Help
28+
29+
For usage questions, the best place to go to is [StackOverflow](https://stackoverflow.com/questions/tagged/minos).
30+
31+
## Discussion and Development
32+
Most development discussions take place over the [GitHub Issues](https://github.com/minos-framework/minos-python/issues). In addition, a [Gitter channel](https://gitter.im/minos-framework/community) is available for development-related questions.
33+
34+
## License
35+
36+
This project is distributed under the [MIT](https://raw.githubusercontent.com/minos-framework/minos-python/main/LICENSE) license.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Run the tests
2+
==============
3+
4+
In order to run the tests, please make sure you have the `Docker Engine <https://docs.docker.com/engine/install/>`_
5+
and `Docker Compose <https://docs.docker.com/compose/install/>`_ installed.
6+
7+
Move into tests/ directory
8+
9+
`cd tests/`
10+
11+
Run service dependencies:
12+
13+
`docker-compose up -d`
14+
15+
Install library dependencies:
16+
17+
`make install`
18+
19+
Run tests:
20+
21+
`make test`
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Set up a development environment
2+
=================================
3+
4+
Since we use `poetry` as the default package manager, it must be installed. Please refer to
5+
`https://python-poetry.org/docs/#installation`.
6+
7+
Run `poetry install` to get the dependencies.
8+
9+
Run `pre-commit install` to set the git checks before commiting.
10+
11+
Make yourself sure you are able to run the tests. Refer to the appropriate section in this guide.

0 commit comments

Comments
 (0)