diff --git a/README.md b/README.md index 7d8af47..f2529b6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Giges -The one hundred arms giant in charge of Tesselo's integrations +The one hundred arms giant in charge of Tesselo integrations ## Install runtime dependencies diff --git a/dev_requirements.txt b/dev_requirements.txt index 43d5343..3c4979f 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.9 +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --output-file=./dev_requirements.txt dev_requirements.in @@ -12,9 +12,9 @@ attrs==21.2.0 # via pytest black==21.6b0 # via -r dev_requirements.in -boto3==1.17.101 +boto3==1.17.102 # via -r dev_requirements.in -botocore==1.20.101 +botocore==1.20.102 # via # boto3 # s3transfer diff --git a/giges/app.py b/giges/app.py index 50e537d..cb83320 100644 --- a/giges/app.py +++ b/giges/app.py @@ -1,5 +1,4 @@ import connexion -from connexion_compose import compile_schema from connexion.apps.flask_app import FlaskApp from connexion.resolver import RestyResolver from flask import Flask @@ -10,11 +9,11 @@ def create_app(self): return app def create_connexion_app(): - connexion_app = App(__package__) + connexion_app = App(__package__, specification_dir="schemas/") flask_app = connexion_app.app connexion_app.add_api( - compile_schema('giges/schemas'), + "api.yml", validate_responses=True, strict_validation=True, resolver=RestyResolver("giges.handlers") @@ -23,3 +22,5 @@ def create_connexion_app(): return connexion_app +def create_flask_app(): + return create_connexion_app().app diff --git a/giges/schemas/api.yml b/giges/schemas/api.yml index 41336f5..a4f70ab 100644 --- a/giges/schemas/api.yml +++ b/giges/schemas/api.yml @@ -1,8 +1,8 @@ -openapi: '3.0.2' -swagger: '' +openapi: '3.0.3' info: title: Tesselo Giges integrations API description: 'One giant with 50 heads and 100 arms' + version: 0.0.1 contact: name: Tesselo integrations x-slack: '#tech-team' @@ -13,8 +13,11 @@ servers: security: [] -basePath: '' -consumes: '' -produces: '' -schemes: '' -definitions: '' +paths: + /ping: + get: + operationId: giges.handlers.health.ping + summary: Pong that ping + responses: + 200: + description: 'Health check result' diff --git a/giges/schemas/paths/health.yml b/giges/schemas/paths/health.yml deleted file mode 100644 index 353b41b..0000000 --- a/giges/schemas/paths/health.yml +++ /dev/null @@ -1,16 +0,0 @@ -/ping: - get: - operationId: giges.handlers.health.ping - summary: - responses: - 200: - description: 'Health check result' - content: - application/json: - schema: - type: object - properties: - pong: - type: boolean - - diff --git a/requirements.in b/requirements.in index f098e3f..b6d8d0a 100644 --- a/requirements.in +++ b/requirements.in @@ -1,5 +1,3 @@ connexion[swagger-ui] flask<2.0 zappa -typing -git+https://gitlab.com/jsmesami/connexion-compose diff --git a/requirements.txt b/requirements.txt index bbc5d99..5ce8122 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with python 3.9 +# This file is autogenerated by pip-compile with python 3.8 # To update, run: # # pip-compile --output-file=./requirements.txt requirements.in @@ -8,11 +8,11 @@ argcomplete==1.12.3 # via zappa attrs==21.2.0 # via jsonschema -boto3==1.17.101 +boto3==1.17.102 # via # kappa # zappa -botocore==1.20.101 +botocore==1.20.102 # via # boto3 # s3transfer @@ -79,7 +79,7 @@ pip-tools==6.2.0 # via zappa placebo==0.9.0 # via kappa -pyrsistent==0.17.3 +pyrsistent==0.18.0 # via jsonschema python-dateutil==2.8.1 # via @@ -121,8 +121,6 @@ tqdm==4.61.1 # via zappa troposphere==2.7.1 # via zappa -typing==3.7.4.3 - # via -r requirements.in urllib3==1.26.6 # via # botocore diff --git a/setup.py b/setup.py index 218d0c2..387e6fb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import find_packages, setup with open("requirements.in") as f: - install_requires = [line for line in f if line and line[0] not in "#-g"] + install_requires = [line for line in f if line and line[0] not in "#-"] with open("dev_requirements.in") as f: tests_require = [line for line in f if line and line[0] not in "#-"] diff --git a/zappa_init.py b/zappa_init.py new file mode 100644 index 0000000..3415da5 --- /dev/null +++ b/zappa_init.py @@ -0,0 +1,4 @@ +from giges.app import create_flask_app + +app = create_flask_app() + diff --git a/zappa_settings.json b/zappa_settings.json new file mode 100644 index 0000000..0d7daba --- /dev/null +++ b/zappa_settings.json @@ -0,0 +1,19 @@ +{ + "staging": { + "app_function": "zappa_init.app", + "aws_region": "eu-central-1", + "project_name": "giges", + "profile_name": "default", + "runtime": "python3.8", + "s3_bucket": "zappa-giges-staging", + "domain": "integrations-staging.tesselo.com", + "certificate_arn": "arn:aws:acm:us-east-1:595064993071:certificate/3cac1dfe-5915-4325-91fa-a53952cbd2e1" + }, + "production": { + "log_level": "WARNING", + "extends": "staging", + "project_name": "giges", + "s3_bucket": "zappa-giges-production", + "domain": "integrations.tesselo.com" + } +}