JavaScript generator of cloud-config files
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
scripts
.gitignore
README.md
bower.json
index.js

README.md

halcyon-cloud-config

JavaScript generator of cloud-config files, using Halcyon to deploy Haskell applications. Intended for use with DigitalOcean. Supports CentOS 7.0 and Ubuntu 14.04.

Usage

The generated cloud-config file performs a number of actions:

  1. Creates a new user account to install and run the application, named app.
  2. Starts a setup monitor OS service.
  3. Installs the OS packages required for Halcyon, including git.
  4. Uses git to install Halcyon into /app/halcyon.
  5. Uses Halcyon to install the application into /app.
  6. Registers the application as an OS service.
  7. Starts the application.
  8. Stops the setup monitor.

The setup monitor responds to HTTP GET requests with a streaming log of the installation process. By default, the log is available for 1 hour after the installation begins.

A Cabal package description file declaring an executable must be included at the top level of the application source repository. The name of the executable will be used as the OS service name, and as part of the default command for running the application.

Example

halcyon-cloud-config is used by Haskell on DigitalOcean. Please see the source code of halcyon-website for a complete usage example.

Reference

formatDigitalOceanUserData(platform, sourceUrl, opts)

Returns a cloud-config file as a string, intended to be supplied as the user_data parameter to the DigitalOcean “Create a new droplet” API endpoint.

Argument Description
platform Either centos or ubuntu. Required.
sourceUrl git URL of the application source repository. Required.
opts.envVars Environment variables to set both before installing and running the application.
opts.command Command to run the application. Defaults to /app/bin/${executable}.
opts.description Application description. Defaults to Haskell on DigitalOcean app.
opts.port Application listening port. Defaults to 8080.
opts.monitorLife Time during which the setup monitor is active, in seconds. Defaults to 3600.
opts.monitorPort Setup monitor listening port. Defaults to 4040.

Installation

$ bower install halcyon-cloud-config

Scripts using halcyon-cloud-config must be processed with webpack in order to include the required platform-specific configuration files.

About

Made by Miëtek Bak. Published under the MIT X11 license. Not affiliated with DigitalOcean.