diff --git a/.gitignore b/.gitignore index 2ac3df2..dd24db2 100644 --- a/.gitignore +++ b/.gitignore @@ -108,8 +108,6 @@ venv.bak/ # mypy .mypy_cache/ -.vscode - /files/ /files2/ alembic.ini diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..55cc134 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Flask", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "app.py", + "FLASK_DEBUG": "1" + }, + "args": [ + "run", + "--no-debugger", + ], + "jinja": true, + "justMyCode": false + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9b38853 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..3e4fa1e --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,31 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "poetry run flask run --debug", + "type": "shell", + "command": "poetry run flask run --debug", + "group": "none", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "runOptions": { + "runOn": "folderOpen", + } + }, + { + "label": "poetry run fastapi dev rhinventory/api/app.py", + "type": "shell", + "command": "poetry run fastapi dev rhinventory/api/app.py", + "group": "none", + "presentation": { + "reveal": "always", + "panel": "new" + }, + "runOptions": { + "runOn": "folderOpen", + } + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index dbc2ed6..544153f 100644 --- a/README.md +++ b/README.md @@ -52,16 +52,7 @@ fastapi dev rhinventory/api/app.py If there are no database migrations: run the script `./ops/deploy.sh` -If there are database migrations: - -```sh -ssh retroherna.org -cd /var/www/rhinventory -sudo -u flask git pull -sudo -u flask poetry run alembic upgrade head -# Correct any issues should they arise -sudo systemctl restart www_rhinventory -``` +If there are database migrations: run the script `./ops/deploy_with_migration.sh` ## How to run scripts