-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
65 changed files
with
624 additions
and
699 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,42 @@ | ||
# This overwrites select settings from the main docker-compose.yml. | ||
# WARNING: THIS SHOULD NOT BE USED DIRECTLY | ||
version: '3' | ||
services: | ||
# Update this to the name of the service you want to work with in your docker-compose.yml file | ||
db: | ||
image: postgres:14 | ||
|
||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: relecloud | ||
POSTGRES_HOST: db | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_PORT: 5432 | ||
|
||
restart: unless-stopped | ||
|
||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
|
||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres -d relecloud"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
app: | ||
build: | ||
build: | ||
context: . | ||
dockerfile: .devcontainer/Dockerfile_dev | ||
dockerfile: Dockerfile_dev | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
network_mode: service:db | ||
environment: | ||
DBSERVER_USER: postgres | ||
DBSERVER_DB: relecloud | ||
DBSERVER_HOST: db | ||
DBSERVER_PORT: 5432 | ||
DBSERVER_PASSWORD: postgres | ||
POSTGRES_USERNAME: postgres | ||
POSTGRES_DATABASE: relecloud | ||
POSTGRES_HOST: db | ||
POSTGRES_PASSWORD: postgres | ||
|
||
command: sleep infinity | ||
|
||
volumes: | ||
- .:/workspace:cached | ||
- ..:/workspace:cached | ||
|
||
volumes: | ||
postgres-data: |
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,3 @@ | ||
* text=auto eol=lf | ||
*.{cmd,[cC][mM][dD]} text eol=crlf | ||
*.{bat,[bB][aA][tT]} text eol=crlf |
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,74 @@ | ||
name: Update repository with Cruft | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 2 * * 1" # Every Monday at 2am | ||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- add-paths: . | ||
body: Use this to merge the changes to this repository. | ||
branch: cruft/update | ||
commit-message: "chore: accept new Cruft update" | ||
title: New updates detected with Cruft | ||
- add-paths: .cruft.json | ||
body: Use this to reject the changes in this repository. | ||
branch: cruft/reject | ||
commit-message: "chore: reject new Cruft update" | ||
title: Reject new updates detected with Cruft | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Cruft | ||
run: pip3 install cruft | ||
|
||
- name: Check if update is available | ||
continue-on-error: false | ||
id: check | ||
run: | | ||
CHANGES=0 | ||
if [ -f .cruft.json ]; then | ||
if ! cruft check; then | ||
CHANGES=1 | ||
fi | ||
else | ||
echo "No .cruft.json file" | ||
fi | ||
echo "has_changes=$CHANGES" >> "$GITHUB_OUTPUT" | ||
- name: Run update if available | ||
if: steps.check.outputs.has_changes == '1' | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub" | ||
cruft update --skip-apply-ask --refresh-private-variables | ||
git restore --staged . | ||
- name: Create pull request | ||
if: steps.check.outputs.has_changes == '1' | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
add-paths: ${{ matrix.add-paths }} | ||
commit-message: ${{ matrix.commit-message }} | ||
branch: ${{ matrix.branch }} | ||
delete-branch: true | ||
branch-suffix: timestamp | ||
title: ${{ matrix.title }} | ||
body: | | ||
This is an autogenerated PR. ${{ matrix.body }} | ||
[Cruft](https://cruft.github.io/cruft/) has detected updates from the Cookiecutter repository. |
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,30 @@ | ||
name: devcontainer CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- ".devcontainer/**" | ||
- ".github/workflows/devcontainer-ci.yaml" | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- ".devcontainer/**" | ||
- ".github/workflows/devcontainer-ci.yaml" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 20.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20.x | ||
- run: npm install -g @devcontainers/cli | ||
- run: devcontainer build --config ./.devcontainer/devcontainer.json --workspace-folder "$(pwd)" |
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,50 @@ | ||
name: Python check | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
test_package: | ||
|
||
name: Test ${{ matrix.os }} Python ${{ matrix.python_version }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-20.04"] | ||
python_version: ["3.8", "3.9", "3.10", "3.11"] | ||
services: | ||
postgres: | ||
image: postgres:14 | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
|
||
python-version: ${{ matrix.python_version }} | ||
architecture: x64 | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install -r requirements-dev.in | ||
playwright install --with-deps | ||
python3 -m pip install -e src | ||
- name: Seed data and run Pytest tests | ||
run: | | ||
python3 src/fastapi_app/seed_data.py | ||
python3 -m pytest | ||
env: | ||
POSTGRES_HOST: localhost | ||
POSTGRES_USERNAME: postgres | ||
POSTGRES_PASSWORD: postgres | ||
POSTGRES_DATABASE: postgres |
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,18 @@ | ||
{ | ||
// 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: FastAPI", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "uvicorn", | ||
"args": [ | ||
"fastapi_app:app", | ||
"--reload" | ||
], | ||
} | ||
] | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Microsoft Corporation | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.