Skip to content

Commit

Permalink
Add a nice interactive flask shell to the development container and d…
Browse files Browse the repository at this point in the history
…ocument it's usage (#1473)
  • Loading branch information
gabrielBusta committed May 16, 2024
1 parent d2790ea commit 2c12ae4
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 586 deletions.
57 changes: 57 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,63 @@ Run: ``source startup.sh``

You should be all set to kick off some staging releases. The script will detect if your Taskcluster client has expired and automatically create a new one.

Running an Interactive Flask Shell for Development
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section describes how to create an interactive shell environment for the Flask applications, which is useful for development and testing purposes.

Setting up for the Admin API:

1. Set the environment variable for the Flask application

::

export FLASK_APP="shipit_api.admin.flask:app"

2. Define the container in which the Flask application is running

::

export SHIPIT_API_CONTAINER="shipit-api-1"

3. Access the Docker container's interactive shell

::

docker exec -it "$SHIPIT_API_CONTAINER" /bin/bash

4. Once inside the container, start the interactive Flask shell using Poetry

::

poetry run flask shell

Setting up for the Public API:

1. Set the environment variable for the Flask application

::

export FLASK_APP="shipit_api.public.flask:app"

2. Define the container in which the Flask application is running

::

export SHIPIT_API_CONTAINER="shipit-public-1"

3. Access the Docker container's interactive shell

::

docker exec -it "$SHIPIT_API_CONTAINER" /bin/bash

4. Once inside the container, start the interactive Flask shell using Poetry

::

poetry run flask shell

To provide all required sign offs on staging xpi releases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ ENV WEB_CONCURRENCY=3
USER app

RUN poetry install --only main
RUN poetry install --only dev

CMD ["/app/docker.d/init.sh", "admin"]
Loading

0 comments on commit 2c12ae4

Please sign in to comment.