Skip to content

Commit

Permalink
Launch project on VS Code startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanqui committed Jan 8, 2025
1 parent 15bbc5a commit 5c54e21
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ venv.bak/
# mypy
.mypy_cache/

.vscode

/files/
/files2/
alembic.ini
Expand Down
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
31 changes: 31 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -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",
}
}
]
}
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5c54e21

Please sign in to comment.