Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pydantic 2, better cli, docker-compose #71

Merged
merged 15 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions .github/workflows/postman.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
name: Automatically build Postman documentation

on:
on:
workflow_dispatch:
inputs:
versionName:
description: 'The new version name'
required: true
default: '1.0.0'
releaseNotes:
description: 'The new version release notes'
required: false
default: ''

jobs:
automated-api-tests:
runs-on: arc-runner-k8s
steps:
- uses: actions/checkout@v3
- name: Install Postman CLI
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: |
curl -o- "https://dl-cli.pstmn.io/install/linux64.sh" | sh
- name: Login to Postman CLI
run: postman login --with-api-key ${{ secrets.POSTMAN_API_KEY }}
- name: Run API tests
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Get OpenAPI schema
run: |
postman collection run "${{ github.workspace }}/postman/collections/Automations: API-First Workflows.json" -e "19614303-61306d0f-9f72-418f-80ba-1561218563c9" --integration-id "129783-${{ github.run_id }}"
# Lint your API using Postman CLI
postman api lint --integration-id 129783
python main.py get-openapi
- name: Push OpenAPI to Postman
id: pushApi
uses: davidespihernandez/push-openapi-to-postman@v1
with:
path-to-definition: ./openapi.json
postman-api-key: ${{ secrets.POSTMAN_API_KEY }}
api-id: ${{ vars.POSTMAN_API_ID }}
api-path-to-file-name: openapi.json
version-name: ${{ github.event.inputs.versionName }}
release-notes: ${{ github.event.inputs.releaseNotes }}
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ dmypy.json
# Pyre type checker
.pyre/

# vscode history
.history/
.vscode/settings.json
coverage.lcov
# vscode
.history
.vscode

# pytest
coverage.lcov
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ RUN tar -xf unipoll-api-*.tar.gz --strip-components=1

RUN pip install .

ENTRYPOINT [ "unipoll-api" ]
ENTRYPOINT [ "unipoll-api", "run" ]
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
mongodb:
image: 'mongo:latest'
ports:
- '27017:27017'
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: changeme

api:
build: .
ports:
- '80:8000'
environment:
MONGODB_URL: mongodb://root:changeme@mongodb:27017
PORT: 8000
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@


if __name__ == "__main__":
app.run()
app.cli_entry_point()
Loading