Skip to content

Instantly share code, notes, and snippets.

@NickBusey
Last active September 29, 2023 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickBusey/a2107705c3c524283ae725c0ca44f4b0 to your computer and use it in GitHub Desktop.
Save NickBusey/a2107705c3c524283ae725c0ca44f4b0 to your computer and use it in GitHub Desktop.
Remote dev tutorial - ReleaseHub into Release

date: 2022-10-20

How to use remote development environments with Release

Release's remote development environments allow you to "mount" an ephemeral environment to your local computer, and work on it as you would if you were developing locally.

You use your normal IDE, and when you save, we automatically sync your changes up to the server. If your server is configured with live reloading, your changes will appear in near real-time.

You can mount and access ports on your machine, mount your database to a local port and use your favorite database GUI tool to interact with it.

Setting up a remote development environment is straight forward and takes just a few lines of yaml.

Setting up a Development Environment

Prerequisites

First things first, you need a working, deployed application on Release. If you don't already have a working application, go through the Getting Started section in the Release documentation and then through the an Example application tutorial. The Full stack voting app is a good place to start.

Configuring your Application Template

The Application Template schema definiton defines a top-level block named development_environment. In brief, you use this to override how the application is normally deployed, and how it should behave instead when using development mode.

Here is an example development_environment block that works for the Full stack voting app referenced above.

development_environment:
services:
  - name: vote
    command: python app.py
    sync:
    - remote_path: "/app"
      local_path: "./vote"
    port_forwards:
    - remote_port: '80'
      local_port: '5000'
  - name: result
    command: nodemon server.js
    port_forwards:
    - remote_port: '80'
      local_port: '5001'
    sync:
    - remote_path: "/app"
      local_path: "./result"

Plug this in to the top level of your Application Template. Click Save as new version.

Connecting to a Development Enviroment

Now that your application is all configured, it's time to start developing!

Make sure have installed the Release cli and run release auth login.

First, select the app you want to use with release apps select.

Next, select the environment you want to use with release environments select.

Finally, from within the root of your local copy of the repository you want to debug, kick off the remote dev process with release environments dev.

Once everything turns green, you should be able to access http://localhost:5000 and http://localhost:5001 returning the vote and result services respectively (or whichever ports you configured for your application).

You should be able to edit files locally, refresh the browser, and see your changes.

Finally you should be able to view and tail the logs inside the ~/.releasehub/dev/ folder to see the output of the different commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment