Forge Home

stagecoach

Installs and configures StageCoach for Node.js application deployment

8,428 downloads

7,317 latest version

4.9 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

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

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'joshsouza-stagecoach', '0.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add joshsouza-stagecoach
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install joshsouza-stagecoach --version 0.0.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

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 :)