Forge Home

stagecoach

Installs and configures StageCoach for Node.js application deployment

Josh Souza

joshsouza

7,561 downloads

6,607 latest version

4.9 quality score

Version information

  • 0.0.3 (latest)
  • 0.0.2
  • 0.0.1
released Feb 26th 2016
This version is compatible with:
  • Ubuntu
    ,
    RedHat
    ,
    CentOS

Start using this module

Documentation

joshsouza/stagecoach — version 0.0.3 Feb 26th 2016

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with stagecoach
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

This module installs StageCoach, a simple framework for deploying node.js web applications to your servers that can run multiple apps on the same server, keep them running with forever, and restart them gracefully at reboot time.

Module Description

The StageCoach module will download check out the StageCoach repository to your system and ensure that it is properly configured for use. If requested it will manage a user account and group for managing your application deployments, and it will add itself to the system's default path so that remote deployment becomes a breeze. The module has no service to manage itself, and does not handle the actual deployments itself, but allows you to easily add a system to your list of deployable servers.

StageCoach expects that Node.JS, nvm, and forever will be available on your system in order to operate, so you will need to ensure that those are present, but this module will function regardless of whether StageCoach's dependencies are in place. (Making it so that no ordering is necessary with other modules that install node/forever)

Setup

Requirements/Dependencies

This module depends on puppetlabs/vcsrepo and the git provider. Thus you must have git installed on the system for this module to work properly.

What stagecoach affects

  • By default, /opt/stagecoach will be a checked out git repository from the main github URL for the StageCoach project
  • /opt/stagecoach/settings will be configured properly for deployments to work
  • /opt/stagecoach/apps will be created as the root for deployments
  • Optionally (on by default) the 'stagecoach' user/group will be created to handle file ownership and execution of the apps
  • Optionally (on by default) the binaries will be added to the system path (using the /etc/profiles.d/*.sh model)

Usage

Simply include the module as usual, using Hiera to adjust any parameters

include stagecoach

Or specify parameters in resource format to define them explicitly

Testing

Unit tests:

bundle exec rake test

Acceptance tests:

bundle exec rake acceptance
bundle exec rake acceptance[centos6,onpass,yes]

Parameters to acceptance are: OS to test (see rakefile), BEAKER_destroy value, BEAKER_provision value

For initial test, you'd want [OS,no,yes]

For subsequent tests, you'd want [OS,no,no]

For normal cases, you can just pass [OS] and it'll only tear it down if it doesn't pass

Reference

  • ::stagecoach - Main entrypoint to the class
  • ::stagecoach::params - Default parameter logic contained here
  • ::stagecoach::install - Handles checkout of the repository and user/group creation
  • ::stagecoach::config - Handles defining the settings file and 'apps' folder

Limitations

This module will only function on Linux (possibly Unix) based OS'es, and on Darwin (Mac) it will not automatically add the binaries to the system's path.

Development

Read the contributing file, but generally:

  • Fork
  • Write good code
  • Write good tests for your code
  • Get your tests to pass (both unit and acceptance)
  • Commit/push
  • Put in a pull request
  • Recieve gratitude for your contribution :)