rails

pdk
Setup of a rails environment for capistrano deployment, using initforthe-capistrano.
Initforthe

Initforthe

initforthe

8,668 downloads

1,074 latest version

5.0 quality score

Version information

  • 0.4.9 (latest)
  • 0.4.8
  • 0.4.7
  • 0.4.6
  • 0.4.4
  • 0.4.3
  • 0.4.2
  • 0.4.0
  • 0.3.0
  • 0.2.3
  • 0.2.2
  • 0.2.0
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
released Feb 28th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
  • Puppet >= 4.10.0 < 7.0.0
  • Debian
    ,
    Ubuntu

Start using this module

Documentation

initforthe/rails — version 0.4.9 Feb 28th 2020

rails

Table of Contents

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

Description

This module sets up a rails app ready for deployment via capistrano.

It assumes environment variables are loaded via dotenv-rails or similar.

Setup

Beginning with rails

The most simple usage is as follows:

include rails

rails::app { 'my_app': }

This will create a capistrano deployment in /var/www/my_app and put environment variables in /etc/defaults/my_app.

Usage

Configure all rails deployments

class { 'rails':
  user        => 'deploy',
  deploy_root => '/srv/apps',
}

Set up a rails app

rails::app { 'my_app':
  env => {
    'RAILS_ENV'       => 'staging',
    'SECRET_KEY_BASE' => '1234567890',
  }
}

Reference

Classes:

Defined Types:

Classes

rails

Sets up the root for all rails app deployments. Set the following parameters if you want something other than the default settings:

user

Which user you want to own the deployments. The user must exist already. Default: root

deploy_root

The root for your deployments. Default: /var/www

Defined Types

rails::app

Sets up a deployment for a single app. Set the following parameters if you want something other than the default settings:

app_environment

The environment the application should run under. Default: production

db_opts

A hash of options to be passed to the database.yml config file.

env_vars

A hash of environment variables to set for the app. Default: {}

Limitations

This module has only been tested on Debian-based OSes. YMMV with others.

Development

Please follow the guidance for contributing on the Puppet Forge

Getting things going

$ bundle install
$ gem install pdk

Testing

$ pdk test unit

Publishing (from master only)

Make sure everything is committed and pushed to master first. Direct changes to master should not be made.

For a minor version bump:

$ bundle exec rake module:release

For anything else:

$ bundle exec rake module:clean module:bump_commit:TYPE module:tag
$ git push && git push --tags

Details of type can be found by running rake -T