Skip to content

Manage ruby bundles through Puppet

License

Notifications You must be signed in to change notification settings

opus-codium/puppet-bundle

Repository files navigation

bundle

Build Status Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores License

Table of Contents

Overview

Manage Ruby bundles using bundler.

Module Description

This module installs bundler and aims at making it easy to manage Ruby applications.

Setup

What bundle affects

  • Installed packages;
  • Installed gems (when deployment is set to false).

Beginning with bundle

The following example deploys a fictive Rails application:

$app_directory = '/var/www/app'

vcsrepo { $app_directory:
  ensure   => latest,
  provider => 'git',
  source   => '[email protected]/repo.git',
  user     => 'deploy',
}

bundle::install { $app_directory:
  user  => 'deploy',
  group => 'deploy',
}

bundle::exec { "${app_directory}:rake db:migrate":
  user        => 'app',
  group       => 'app',
  environment => ['RAILS_ENV=production'],
  refreshonly => true,
}

exec { 'notify-app':
  command     => "/usr/bin/touch ${app_directory}/tmp/restart.txt",
  refreshonly => true,
}

Vcsrepo[$app_directory] ~>
Bundle::Install[$app_directory] ~>
Bundle::Exec["${app_directory}:rake db:migrate"] ~>
Exec['notify-app']

Usage

Only the bundle, bundle::install and bundle::exec classes are intended to end users usage. See reference documentation bellow.

Reference

Limitations

The current implementation supports Debian GNU/Linux and FreeBSD. Patches to add support to more platforms are welcome.

Contributing

  1. Fork it ( https://github.com/opus-codium/puppet-bundle/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request