-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
API: improve Dockerfile, add migrations, add command to create access…
… keys
- Loading branch information
Giacomo Licari
committed
Feb 28, 2024
1 parent
488116b
commit f2972e6
Showing
11 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import logging | ||
|
||
import click | ||
from flask.cli import with_appcontext | ||
|
||
from .services.database import AccessKey | ||
from .utils import generate_access_key | ||
|
||
|
||
@click.command(name='create_access_keys') | ||
@with_appcontext | ||
def create_access_keys_cmd(): | ||
access_key_id, secret_access_key = generate_access_key() | ||
access_key = AccessKey() | ||
access_key.access_key_id = access_key_id | ||
access_key.secret_access_key = secret_access_key | ||
access_key.save() | ||
logging.info(f'Access Key ID : ${access_key_id}') | ||
logging.info(f'Secret access key: ${secret_access_key}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
|
||
echo "==> $(date +%H:%M:%S) ==> Migrating DB models... " | ||
FLASK_APP=api python -m flask db upgrade | ||
|
||
echo "==> $(date +%H:%M:%S) ==> Running Gunicorn... " | ||
exec gunicorn --bind 0.0.0.0:8000 "api:create_app()" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters