Skip to content

A web app that utilizes CODER environment vars and coder-cli

Notifications You must be signed in to change notification settings

bcdr-demos/environment-automation

Repository files navigation

environment automation

An express app that uses built-in features from Coder environments and coder-cli to do some cool "automated" stuff outside of Coder's main U.

Web app screenshot

Architecture

This is just a simple express app with Pug view engine. Here's what's important to understand in this demo app:

bin/www - web server (nothing special to Coder)

app.js - controls express & routes (nothing special to Coder)

routes/index.js - uses env variables and coder-cli to get info about:

  • the current environment (env vars)
  • all Coder environments by the environment owner
  • all Coder images

routes/actions.js - actually modifies stuff in a Coder deployment (create environment, run command, etc)

views/index.pug - renders the index page and displays the Coder info

Getting started

Ideally, this is installed in a Coder environment. Here's why:

However, the create/command exec functionality could work on any system with coder-cli installed.

  1. [If using Coder]: Use an image with Node installed. We recommend codercom/enterprise-node:ubuntu in the Docker Hub.
  2. Clone this repo
  3. npm install
  4. To run the web app, npm start
  5. [If using Coder]: Open a Dev URL on port 3000 to access the web app

Contributions are welcome 🙂

⚠️ We do not recommend using this app in production for your organization. This is just a demonstration of capabilities and is not secure.

About

A web app that utilizes CODER environment vars and coder-cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published