• Stars
    star
    666
  • Rank 67,706 (Top 2 %)
  • Language
    Ruby
  • License
    GNU Lesser Genera...
  • Created over 15 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple Rails deployment and configuration management. 15 minute deploys of Rails 2, 3, or 4 apps.

Moonshine

Moonshine is Rails deployment and configuration management done right.

By leveraging capistrano and puppet, moonshine allows you have a working application server in 15 minutes, and be able to sanely manage it's configuration from the comfort of your version control of choice.

To get started, check out our tutorial. It covers configuring and deploying your application for the first time with Moonshine.

Once you're a bit more comfortable with Moonshine, you'll find our documentation on the wiki to be helpful!

Requirements

  • A server running Ubuntu 12.04 or 14.04 LTS (Want to see your favorite platform supported? Fork Moonshine on GitHub!)
  • A Rails 2.3 or Rails 3 app. Rails 4 is supported with the plugger gem.
  • A user on this server that can:
    • Execute commands via sudo
    • Access your application's source code repository

Installation

It's also pretty simple!

Rails 2

$ script/plugin install git://github.com/railsmachine/moonshine.git
$ script/generate moonshine

Rails 3

$ script/rails plugin install git://github.com/railsmachine/moonshine.git
$ script/rails generate moonshine

Rails 4

Add gem 'plugger' to your Gemfile and bundle install, then:

$ plugger install git://github.com/railsmachine/moonshine.git
$ script/rails generate moonshine

If you get errors about not being able to find shadow_puppet during deploys, you'll also need to add the following to your Gemfile:

gem 'shadow_puppet', :require => false

Running Tests

It's easy enough:

$ gem install shadow_puppet isolate-scenarios
$ rake spec

isolate-scenarios is used to test against multiple versions of Rails. To run all scenarios at once:

$ isolate-scenarios rake spec

Getting Help

You can find more examples in the documentation and on the Wiki.

For help or general discussion, visit the Moonshine newsgroup.

Passenger Enterprise Support

We've added support for Passenger Enterprise Edition! In order to install it, you need to make a few changes to moonshine.yml. Phusion now provides a gem server for Passenger Enterprise. You will need to put your license file in app/manifests/templates and call it passenger-enterprise-license so we can put it in the right place during install.

This is what a passenger enterprise block in moonshine.yml should look like (in addition to your usual Passenger settings):

:passenger:
  :version: 4.0.10
  :enterprise: true
  :download_token: YOUR-PASSENGER-ENTERPRISE-DOWNLOAD-TOKEN
  :rolling_restarts: true

Brightbox Ruby

Compiling ruby from source is time and CPU consuming. In an attempt to speed up ruby upgrades and make it easier to roll back to the previous version, we've added support for Brightbox's Ruby packages. Setting it up is easy, just set the ruby line in config/moonshine.yml to brightbox193 or brightbox21.

Limitations

  • Ubuntu 10.04: Brightbox doesn't provide packages for Ruby 2.1.x. If you want it, you'll need to upgrade to at least 12.04.

A Word on Rails 4

We've been torturing ourselves trying to turn Moonshine into a gem ever since it was announced that Rails 4 was dropping support for plugins. Moonshine is... different... and we think it actually makes sense as a plugin. So, instead of turning Moonshine, and the dozens of Moonshine plugins we've written, into a gem, we decided to add plugin support back to Rails 4! That's where plugger comes in. Just add it to your Gemfile and bundle install and voila, plugins are back!

Keeping Your App From Loading Manifests

By default, everything within the app directory is eager-loaded by the app at startup in production mode (and staging). That's not good. So, to keep that from happening, add this to config/application.rb inside the Application class:

path_rejector = lambda { |s| s.include?("app/manifests") }
config.eager_load_paths = config.eager_load_paths.reject(&path_rejector)
ActiveSupport::Dependencies.autoload_paths.reject!(&path_rejector)

That'll keep the manifests from loading when the app starts up!

Getting rid of that annoying message when you run rails console

With Rails 4, it doesn't want you to use the --binstubs argument for bundler, so it's now optional. If you're using Moonshine and Rails 4, add this to config/moonshine.yml, and you'll be all set:

:bundler:
  :disable_binstubs: true

After your next deploy, you should be able to run rails console without that annoying error message.

All content copyright ยฉ 2014, Rails Machine LLC

More Repositories

1

nagiosharder

Ruby API for scraping Nagios
Ruby
115
star
2

rump

Do Puppet runs locally from a Git checkout. puppet-solo?!
Ruby
113
star
3

shadow_puppet

A Ruby DSL for Puppet
Ruby
84
star
4

railsmachine

RailsMachine is a collection of libraries for automating deployment and hosting configuration for Ruby on Rails applications using Capistrano and Rake.
Ruby
29
star
5

capistrano-cowboy

Deploy like a cowboy, pew pew!
Ruby
25
star
6

lita-ext

A collection of Lita extensions.
Ruby
18
star
7

moonshine_god

Simple installation and configuration management for god
Ruby
15
star
8

plover

Ruby
14
star
9

pagerduty-shift-announcer

Campfire and SMS announcer for pagerduty shift changes
Ruby
11
star
10

shadow_facter

ShadowFacter is a Ruby DSL for Facter
Ruby
8
star
11

moonshine_astrails_safe

Install and configure astrails-safe
Ruby
8
star
12

moonshine_wordpress

Configures a WordPress blog to run alongside your Rails app
Ruby
8
star
13

galera_cluster_migrations

A gem to help perform Rails database migrations with MariaDB Galera Cluster.
Ruby
8
star
14

plugger

We need plugins in Rails 4. So we put them back.
Ruby
7
star
15

moonshine_memcached

Install and configure memcached
Ruby
7
star
16

moonshine_sphinx

Install and configure sphinx
Ruby
7
star
17

utf8mb4_conversion_scripts

Scripts to help with converting a Rails database to utf8mb4
Ruby
6
star
18

libshadow

Provides /etc/shadow password management.
C
6
star
19

moonshine_scout

Install and configure the Scout agent
Ruby
6
star
20

moonshine_redis

A Moonshine plugin for installing and managing Redis, the advanced persistent key-value store.
HTML
5
star
21

moonshine_iptables

Iptables setup and configuration through your Moonshine manifest
Ruby
5
star
22

moonshine_mariadb

A Moonshine plugin for installing and configuring MariaDb Galera Cluster
Ruby
5
star
23

moonshine_ssh

A Moonshine plugin providing secure SSH defaults and simple configuration management
Ruby
4
star
24

parseconfig

simple config parser for files in the format of "param = value"
Ruby
4
star
25

moonshine_xsendfile

Install and configure mod_xsendfile
Ruby
3
star
26

moonshine_mysql_slave

Simple installation and configuration management for a MySQL slave.
Ruby
3
star
27

moonshine_ar_mailer

Simple installation and configuration management for ar_mailer
Ruby
3
star
28

moonshine_vagrant

A plugin for building all the configuration for a local version of an existing stage (like staging or production).
Ruby
3
star
29

moonshine_mmm

A plugin for installing and managing mysql_mmm
Ruby
3
star
30

moonshine_no_www

Moonshine plugin for handling no-www redirects
Ruby
3
star
31

moonshine_heartbeat

This Moonshine plugin allows you to easily integrate heartbeat into your deployment.
Ruby
2
star
32

moonshine_sidekiq

Moonshine plugin for basic Sidekiq configuration and deployment
Ruby
2
star
33

moonshine_omnipitr

Install and manage OmniPITR
Ruby
2
star
34

resque-oink

Resque extension to identify jobs which significantly increase VM heap size using oink
Ruby
2
star
35

moonshine_imagemagick

Ruby
2
star
36

moonshine_geoip

Duty-free, a Moonshine plugin for simple installation and configuration management of GeoIP
Ruby
2
star
37

moonshine_denyhosts

A denyhosts plugin for Moonshine
HTML
2
star
38

moonshine_haproxy

Simple installation and configuration management for haproxy
Ruby
1
star
39

moonshine_pagespeed

A Moonshine plugin for Google's mod_pagespeed Apache module
HTML
1
star
40

moonshine_vsftpd

Install and manage an FTP server
Ruby
1
star
41

moonshine_dj

Moonshine plugin for basic DelayedJob configuration and deployment
Ruby
1
star
42

moonshine_mysql_tools

A plugin for installing some commonly used mysql tools with Moonshine
Ruby
1
star
43

moonshine_moxi

Ruby
1
star
44

moonshine_ordered_hash

Ruby
1
star
45

moonshine_upload_progress

Install and configure mod_upload_progress
Ruby
1
star
46

moonshine_cijoe

Installs and configures cijoe using moonshine
Ruby
1
star
47

moonshine_sysctl

Tune kernel parameters with Moonshine.
Ruby
1
star
48

moonshine_msttcorefonts

A moonshine plugin for installing msttcorefonts
Ruby
1
star
49

moonshine_java

Moonshine plugin for configuring and installing Java
Ruby
1
star
50

moonshine_prince

Moonshine Plugin to Install Prince XML
Ruby
1
star
51

moonshine_pdfkit

Moonshine Plugin for managing PDFKit
Ruby
1
star
52

moonshine_syslog_ng

A syslog_ng recipe for Moonshine
Ruby
1
star
53

moonshine_passenger_monitor

Passenger Memory Monitor
Ruby
1
star
54

moonshine_couchdb

A moonshine plugin for installing and managing couchdb
Ruby
1
star