Skip to content

Commit

Permalink
apply remaining changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
erinecon committed Nov 6, 2024
1 parent 718db3f commit 820a848
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 12 deletions.
68 changes: 58 additions & 10 deletions docs/how-to/build-a-12-factor-app-rock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ the root of the project:
- ``static``
- ``templates``

To change this, the following snippet needs to be added to
the ``rockcraft.yaml``:
To change this list, add the following snippet to the
``rockcraft.yaml``:

.. tabs::

Expand Down Expand Up @@ -134,32 +134,80 @@ Update and deploy the OCI image

1. Make sure that any new files will be included in the new OCI image.
2. Run ``rockcraft pack`` to create the new OCI image.
3. Run ``rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:<path to rock file> docker://localhost:32000/<rock name>:<rock version>`` to upload the OCI image to the local Docker registry.
4. Run ``juju refresh <app name> --path=<relative path to .charm file> --resource flask-app-image=<localhost:32000/<rock name>:<rock version>>`` to deploy the new OCI image.
3. To upload the OCI image to the local Docker registry, run:

.. code-block:: bash
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \
oci-archive:<path to rock file> \
docker://localhost:32000/<rock name>:<rock version>
4. To deploy the new OCI image, run:

.. code-block:: bash
juju refresh <app name> --path=<relative path to .charm file> \
--resource flask-app-image=<localhost:32000/<rock name>:<rock version>>
.. group-tab:: Django

After making a change to your app:

1. Make sure that any new files will be included in the new OCI image.
2. Run ``rockcraft pack`` to create the new OCI image.
3. Run ``rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:<path to rock file> docker://localhost:32000/<rock name>:<rock version>`` to upload the OCI image to the registry.
4. Run ``juju refresh <app name> --path=<relative path to .charm file> --resource django-app-image=<localhost:32000/<rock name>:<rock version>>`` to deploy the new OCI image.
3. To upload the OCI image to the local Docker registry, run:

.. code-block:: bash
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \
oci-archive:<path to rock file> \
docker://localhost:32000/<rock name>:<rock version>
4. To deploy the new OCI image, run:

.. code-block:: bash
juju refresh <app name> --path=<relative path to .charm file> \
--resource django-app-image=<localhost:32000/<rock name>:<rock version>>
.. group-tab:: FastAPI

After making a change to your app:

1. Make sure that any new files will be included in the new OCI image.
2. Run ``rockcraft pack`` to create the new OCI image.
3. Run ``rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:<path to rock file> docker://localhost:32000/<rock name>:<rock version>`` to upload the OCI image to the registry.
4. Run ``juju refresh <app name> --path=<relative path to .charm file> --resource app-image=<localhost:32000/<rock name>:<rock version>>`` to deploy the new OCI image.
3. To upload the OCI image to the local Docker registry, run:

.. code-block:: bash
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \
oci-archive:<path to rock file> \
docker://localhost:32000/<rock name>:<rock version>
4. To deploy the new OCI image, run:

.. code-block:: bash
juju refresh <app name> --path=<relative path to .charm file> \
--resource app-image=<localhost:32000/<rock name>:<rock version>>
.. group-tab:: Go

After making a change to your app:

1. Make sure that any new files will be included in the new OCI image.
2. Run ``rockcraft pack`` to create the new OCI image.
3. Run ``rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false oci-archive:<path to rock file> docker://localhost:32000/<rock name>:<rock version>`` to upload the OCI image to the registry.
4. Run ``juju refresh <app name> --path=<relative path to .charm file> --resource app-image=<localhost:32000/<rock name>:<rock version>>`` to deploy the new OCI image.
3. To upload the OCI image to the local Docker registry, run:

.. code-block:: bash
rockcraft.skopeo --insecure-policy copy --dest-tls-verify=false \
oci-archive:<path to rock file> \
docker://localhost:32000/<rock name>:<rock version>
4. To deploy the new OCI image, run:

.. code-block:: bash
juju refresh <app name> --path=<relative path to .charm file> \
--resource app-image=<localhost:32000/<rock name>:<rock version>>
2 changes: 1 addition & 1 deletion docs/tutorial/django.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Change into the ``django_hello_world`` directory and run the Django application
using ``python manage.py runserver`` to verify that it works.

Test the Django application by using ``curl`` to send a request to the root
endpoint. We may need a new terminal for this -- if we're using Multipass, run
endpoint. We'll need a new terminal for this -- if we're using Multipass, run
``multipass shell rock-dev`` to get another terminal:

.. literalinclude:: code/django/task.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/fastapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Run the FastAPI application using ``fastapi dev app.py --port 8000`` to verify
that it works.

Test the FastAPI application by using ``curl`` to send a request to the root
endpoint. We may need a new terminal for this -- if we're using Multipass, run
endpoint. We'll need a new terminal for this -- if we're using Multipass, run
``multipass shell rock-dev`` to get another terminal:

.. literalinclude:: code/fastapi/task.yaml
Expand Down

0 comments on commit 820a848

Please sign in to comment.