/GoHockey-Back

Primary LanguagePythonApache License 2.0Apache-2.0

OpenAPI generated server

Overview

This server was generated by the OpenAPI Generator project. By using the OpenAPI-Spec from a remote server, you can easily generate a server stub. This is an example of building a OpenAPI-enabled Flask server.

This example uses the Connexion library on top of Flask.

Requirements

Python 3.11

Usage

To run the server, please execute the following from the root directory:

pip3 install --user pipenv
# OR pipx install pipenv
pipenv install
pipenv run server

and open your browser to here:

http://localhost:8080/ui/

Your OpenAPI definition lives here:

http://localhost:8080/openapi.json

Run in Docker

docker build . -t ghb
docker run --detach -p8080:8080 --name ghb ghb
open http://localhost:8080
[...]
docker stop ghb
docker rm ghb

Deploy to GCP Cloud Run

First, commit all changes. Only then run these actions. They use commit SHA to tag the Docker image

# Build docker image
scripts/build.sh

# Push docker image to the GCR container registry
scripts/push.sh

# Update the Cloud Run service
scripts/deploy.sh

Retrieve details of GCP Cloud Run service

gcloud run services list --filter gohockey-back