Editing and building your own customized device code or backend server now needs less than five clicks ;-)

So I’m away from my devices this week so can’t do much coding. However, this was a great opportunity to use the new Github Codespaces feature to make it super easy for anyone to build device code (or our backend server) from scratch.

This work builds on our existing continuous-integration test builds and uses either a bare browser or (optionally) Visual Studio code. I think it might be a great way for anyone who has problems installing and building locally to get a guaranteed “good” build environment in the cloud that works and feels just like you are developing on your local machine.

Here’s some not tested instructions. Feedback requested.

  1. Go to Github and ask to be in the beta. I’m not sure what the process for this is like, because I asked a few months ago and forgot about it until just now. :wink:
  2. Go to the device code or the backend server code and click the button in the upper right that says “Fork”. It will ask you to confirm and you say yes. Then github opens your new “fork” of the master code.
  3. In the upper right of the window click on the “Code” dropdown button. And on that dropdown menu choose “Open with Codespaces”
  4. Github will create a new VM for you (this will take a few minutes the first time you do it). Optionally you can choose to open this new “codespace” using a local “Visual Studio Code” client, or if you do nothing it will appear (in a still quite fast) browser window. You’ll need to wait a few more minutes while the build environment gets setup (first time only). Platformio etc… will be fetching lots of dependencies :wink:
  5. You can now click to build and run just like you are on your local machine (but you didn’t need to install anything). You can also do all the usual things like create pull requests, run debuggers etc…

Screenshot of creating a codespace:

Screenshot of building the server:

Screenshot of building the device code:

7 Likes

I’d like to test these instructions and document them for the docs. Bookmarking now!

1 Like