Skip to content

Commit

Permalink
Docs: Cloud app deployment guides (#6769)
Browse files Browse the repository at this point in the history
* Create EdgeDB Cloud section in guides

* Add Vercel, Netlify EDB Cloud app deploy guides
  • Loading branch information
raddevon authored Feb 1, 2024
1 parent 5179889 commit fed3793
Show file tree
Hide file tree
Showing 10 changed files with 255 additions and 163 deletions.
162 changes: 0 additions & 162 deletions docs/guides/cloud.rst

This file was deleted.

60 changes: 60 additions & 0 deletions docs/guides/cloud/cli.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. _ref_guide_cloud_cli:

===
CLI
===

:edb-alt-title: Using EdgeDB Cloud via the CLI

To use EdgeDB Cloud via the CLI, first log in using
:ref:`ref_cli_edgedb_cloud_login`. Once your login is successful, you will be
able to create an instance using either :ref:`ref_cli_edgedb_instance_create`
or :ref:`ref_cli_edgedb_project_init`, depending on whether you also want to
create a local project linked to your instance.

* :ref:`ref_cli_edgedb_instance_create` with an instance name of
``<org-name>/<instance-name>``.

.. code-block:: bash
$ edgedb instance create <org-name>/<instance-name>
* :ref:`ref_cli_edgedb_project_init` with the ``--server-instance`` option. Set
the server instance name to ``<org-name>/<instance-name>``.

.. code-block:: bash
$ edgedb project init \
--server-instance <org-name>/<instance-name>
Alternatively, you can run ``edgedb project init`` *without* the
``--server-instance`` option and enter an instance name in the
``<org-name>/<instance-name>`` format when prompted interactively.

.. note::

Please be aware of the following restrictions on EdgeDB Cloud instance
names:

* can contain only Latin alpha-numeric characters or ``-``
* cannot start with a dash (``-``) or contain double dashes (``--``)
* maximum instance name length is 61 characters minus the length of your
organization name (i.e., length of organization name + length of instance
name must be fewer than 62 characters)

To use ``edgedb instance create``:

.. code-block:: bash
$ edgedb instance create <org-name>/<instance-name>
To use ``edgedb project init``:

.. code-block:: bash
$ edgedb project init \
--server-instance <org-name>/<instance-name>
Alternatively, you can run ``edgedb project init`` *without* the
``--server-instance`` option and enter an instance name in the
``<org-name>/<instance-name>`` format when prompted interactively.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions docs/guides/cloud/deploy/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. _ref_guide_cloud_deploy:

=============
Deploy an app
=============

:edb-alt-title: Deploying applications built on EdgeDB Cloud

For your production deployment, generate a dedicated secret key for your
instance with :ref:`ref_cli_edgedb_cloud_secretkey_create` or via the web UI's
"Secret Keys" pane in your instance dashboard. Create two environment variables
accessible to your production application:

* ``EDGEDB_SECRET_KEY``- contains the secret key you generated
* ``EDGEDB_INSTANCE``- the name of your EdgeDB Cloud instance
(``<org-name>/<instance-name>``)

If you use one of these platforms, try the platform's guide for
platform-specific instructions:

.. toctree::
:maxdepth: 1

vercel
netlify
36 changes: 36 additions & 0 deletions docs/guides/cloud/deploy/netlify.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
.. _ref_guide_cloud_deploy_netlify:

========================
Deploy an app on Netlify
========================

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Netlify

.. note::

This guide assumes the Git deployment method on Netlify, but you may also
deploy your site using other methods. Just make sure the EdgeDB Cloud
environment variables are set, and your app should have connectivity to
your instance.

1. Push project to GitHub or some other Git remote repository
2. Create and make note of a secret key for your EdgeDB Cloud instance
3. On your Netlify Team Overview view under Sites, click Import from Git
4. Import your project's repository
5. Configure the build settings appropriately for your app
6. Click the Add environment variable button
7. Use the New variable button to add two variables:

- ``EDGEDB_INSTANCE`` containing your EdgeDB Cloud instance name (in
``<org>/<instance-name>`` format)
- ``EDGEDB_SECRET_KEY`` containing the secret key you created and noted
previously.

8. Click Deploy

.. image:: images/cloud-netlify-config.png
:width: 100%
:alt: A screenshot of the Netlify deployment configuration view
highlighting the environment variables section where a user will
need to set the necessary variables for EdgeDB Cloud instance
connection.
26 changes: 26 additions & 0 deletions docs/guides/cloud/deploy/vercel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. _ref_guide_cloud_deploy_vercel:

=======================
Deploy an app on Vercel
=======================

:edb-alt-title: Deploying applications built on EdgeDB Cloud to Vercel

1. Push project to GitHub or some other Git remote repository
2. Create and make note of a secret key for your EdgeDB Cloud instance
3. From Vercel's Overview tab, click Add New > Project
4. Import your project's repository
5. In "Configure Project," expand "Environment Variables" to add two variables:

- ``EDGEDB_INSTANCE`` containing your EdgeDB Cloud instance name (in
``<org>/<instance-name>`` format)
- ``EDGEDB_SECRET_KEY`` containing the secret key you created and noted
previously.

6. Click Deploy

.. image:: images/cloud-vercel-config.png
:width: 100%
:alt: A screenshot of the Vercel deployment configuration view highlighting
the environment variables section where a user will need to set the
necessary variables for EdgeDB Cloud instance connection.
42 changes: 42 additions & 0 deletions docs/guides/cloud/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _ref_guide_cloud:

=====
Cloud
=====

:edb-alt-title: Using EdgeDB Cloud

EdgeDB Cloud is the easiest way to host your EdgeDB instance. We offer two ways
to interact with EdgeDB Cloud: via our CLI or through a graphical web
interface nearly identical to the :ref:`EdgeDB UI <ref_cli_edgedb_ui>`.

.. edb:youtube-embed:: IG1MggUzzH4
.. toctree::
:maxdepth: 2
:hidden:

cli
web
deploy/index
deploy/vercel
deploy/netlify


Questions? Problems? Bugs?
==========================

Thank you for helping us make the best way to host your EdgeDB instances even
better!

* Please join us on `our Discord <https://discord.gg/umUueND6ag>`_ to ask
questions.
* If you're experiencing a service interruption, check `our status page
<https://www.edgedbstatus.com/>`_ for information on what may be
causing it.
* Report any bugs you find by `submitting a support ticket
<https://edgedb.com/p/cloud-support>`_. Note: when using EdgeDB Cloud
through the CLI, setting the ``RUST_LOG`` environment variable to ``info``,
``debug``, or ``trace`` may provide additional debugging information
which will be useful to include with your ticket.
Loading

0 comments on commit fed3793

Please sign in to comment.