• Stars
    star
    401
  • Rank 107,625 (Top 3 %)
  • Language
    Ruby
  • Created about 15 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

Rails and Sinatra deployment made easy

ABOUT:

Inploy was born as an option to setup and deploy Rails applications in an easier and smarter way.

It automatically executes common tasks like migrate the database, install gems, package the assets, clean the cache, notify Hoptoad, restart the server, etc. This means you will not have a big deploy script calld ‘recipe’ like with other tools, only a simple deploy script with a few lines.

It uses Git to version the deploys and to pull or push only the modifications in each one. This means you will not have a lot of folders in the server (only one) with duplicated code and that ech deploy will be very fast.

It is very flexible, meaning you can create templates specifing how specific tasks must behave. As today, there are templates for Locaweb, for Rails 3 using git pull and Rails 3 using git push.

It works by default with Passenger, but you can specify another servers like Mongrel, Thin and Unicorn.

You can execute Inploy from a remote machine or from the server machine, meaning anynone can go to the deployment path and with only one command update the code and execute all the tasks.

As Inploy is very flexible, now you can also use it to execute an installation shell script in a server from an URL.

INSTALLATION:

As a plugin:

script/plugin install git://github.com/dcrec1/inploy.git

As a gem:

sudo gem install inploy

Please remember that when used as a gem, Inploy should be available in the deploy servers.

Rails 2.3.x note

When using rails 2.3.x, you should include the follow line into you Rakefile:

##### Rakefile
load "tasks/inploy.rake"

USAGE

When using Inploy with Rake, there are five tasks:

  • inploy:remote:install from=url

- connects to a list of servers and executes the script from url

  • inploy:remote:setup

- connects to a list of servers
- clones a git repository
- executes rake inploy:local:setup

  • inploy:remote:update or inploy:up

- connects to a list of servers
- executes inploy:local:update

  • inploy:remote:install

- connects to a list of servers
- reads the content of url specified by from=url without downloading the file and executes it

  • inploy:local:setup

- creates directories db and tmp/pids
- copies config/.[example|sample|template] files to config/
- creates the database
- executes init.sh file case it exists
- inits and updates the git submodules
- installs gems
- migrates the database
- updates the crontab from Whenever if being used
- cleans the cache, default tmp/cache
- cleans cached assets in public/assets if Jammit is installed
- starts the Delayed Job worker if script/delayed_job exist
- parses less files if more:parse task exists
- parses compass files if config/initializers/compass.rb exists
- parses coffeescript files with Barista if barista:brew task exist
- package the assets if asset:packager:build_all task exists
- notifies Hoptoad about the deploy, specifing the revision, repository and environment
- notifies NewRelic RPM about the deploy
- restarts the server

  • inploy:local:update

- pulls the repository
- inits and updates the git submodules
- copies config/.[example|sample|template] files to config/
- installs gems
- migrates the database
- updates the crontab from Whenever if being used
- cleans the cache, default tmp/cache
- cleans cached assets in public/assets if Jammit is installed
- restarts the Delayed Job worker if script/delayed_job exists
- parses less files if more:parse task exists
- parses compass files if config/initializers/compass.rb exists
- parses coffeescript files with Barista if barista:brew task exist
- package the assets if asset:packager:build_all task exists
- notifies Hoptoad about the deploy, specifing the revision, repository and environment
- notifies NewRelic RPM about the deploy
- restarts the server

If you don’t want to execute Rake, there are a few shortcuts:

inploy => inploy update => rake inploy:remote:update
inploy setup => rake inploy:remote:setup
inploy install from=url => rake inploy:remote:install from=url

When using inploy as a command, it looks first for config/deploy.rb and then for deploy.rb .

CONFIGURATION

Create a config/deploy.rb file and configure it something like this:

application = "signal"
repository = 'git://github.com/dcrec1/signal.git'
hosts = ['hooters', 'geni']

# OPTIONALS

before_restarting_server do
  rake "important:task"
  run "important_command"
end

path = '/opt'                                # default /var/local/apps
user = 'dcrec1'                              # default deploy
ssh_opts = '-A'                              # default empty
branch = 'new_version'                       # default master
environment = 'staging'                      # default production
sudo = true                                  # default false
cache_dirs = ['public/cache', 'tmp/cache']   # default ['public/cache']
skip_steps = ['install_gems', 'clear_cache'] # default []
app_folder = 'project_folder'                # default empty
login_shell = true                           # default false
bundler_opts = '--binstubs'                  # default '--deployment --without development test cucumber'

The bundler_path option has been removed. To migrate your existing config/deploy.rb file simply replace bundler_path = '/path/to/gems' with bundler_opts = '--path /path/to/gems'

SKIP STEPS

You can skip some steps when running a Rake task, just add “skip_steps” into your rake command line or add “skip_steps” to your deploy.rb to always skip those steps.

Currently the steps available to skip are:

- copy_sample_files: skip copying config/.[example|sample|template] files to config/
- install_gems: skip rake gems:install
- migrate_database: skip rake db:migrate
- clear_cache: skip removing cache directories
- update_crontab: skip updating the crontab with Whenever

  • Usage (params are comma separated):
rake inploy:remote:update skip_steps=install_gems,migrate_database

HOOKS

Currently, the following three hooks are available:

- before_git (not called before initial git clone)
- after_git
- after_setup
- before_restarting_server
- after_restarting_server

To show a “down for maintenance” page during the deployment, use the before_git and after_restarting_server hooks.

If you need another hook, please fork the project and implement it. Or submit an issue, it’s very easy.

say

Use the say method to show messages issued by your hooks.

# Show a simple message
say 'restart custom daemons'

# Show a message (blank output lines are suppressed)
say 'revert local changes' do |output|
  output << `git checkout . 2>&1`
end

CONTRIBUTORS

Inploy is brought to you by:

  • Diego Carrion
  • Douglas Campos
  • Kristopher Murata
  • Vitor Pellegrino
  • Josh Owens
  • Felipe
  • trooster
  • Josef Pospíšil
  • BrunoGrasselli
  • Andy Shen
  • alekenji
  • Erik Dahlstrand
  • Carlos Brando
  • Thomas Ritz
  • Sven Schwyn

LICENSE:

(The MIT License)

Copyright © 2015

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
‘Software’), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

signal

An integration server written in Rails and integrated with metric_fu, rspec, cucumber and maven. Easy to install and easy to use
Ruby
176
star
2

rails6_template

A template for a Rails 5 application
Ruby
124
star
3

kilt

A client that listens to Pivotal Tracker activities and notifies them with Growl (Mac OSx), Libnotify (Linux) or Snarl (Windows)
Ruby
104
star
4

acts_as_solr_reloaded

ActsAsSolr with new features
Ruby
102
star
5

ansible-project-bootstrap

Ansible project boostrap is a default Ansible project you can fork and improve with your needs
Jinja
66
star
6

conventional-changelog-ruby

Ruby lib and executable to generate a conventional changelog
Ruby
50
star
7

activerecord_i18n_defaults

Common attributes translations for Rails 2.2+
Ruby
32
star
8

jetty-solr

A Jetty server with Solr embedded and configured, ready to use with acts_as_solr_reloaded
Shell
28
star
9

shouty

A Twitter-like for your intranet
Ruby
22
star
10

active_lucene

ActiveRecord/ActiveModel's like interface for Lucene
Ruby
21
star
11

gemhub

Simple gem creation
Ruby
20
star
12

remarkable_paperclip

Paperclip Ramarkable Matchers
Ruby
15
star
13

rspec-maven-plugin

Fork of http://svn.codehaus.org/mojo/trunk/sandbox/rspec-maven-plugin/
Java
12
star
14

auth_helpers

AuthHelpers is a collection of modules and controller to extend your Authlogic models. Currently it supports Confirmable and Recoverable behavior.
Ruby
11
star
15

remarkable_thinking_sphinx

Thinking Sphinx Remarkable Matchers
Ruby
10
star
16

github-user-events

A better interface to view GitHub's users's public activity
CoffeeScript
10
star
17

contacts_rails

Google, Yahoo and Live Contacts in your Rails application with only a line of code
Ruby
9
star
18

redtube

A Ruby interface to the Redtube API
Ruby
9
star
19

haml4j

Haml on a Java plataform
Java
8
star
20

remarkable_acts_as_taggable_on

Acts As Taggable On Remarkable Matchers
Ruby
7
star
21

jasmine-jquery-matchers

Jasmine matchers to be used with jQuery
JavaScript
7
star
22

remarkable_inherited_resources

Inherited Resources Remarkable Matchers
Ruby
7
star
23

rocr

Ruby OCR, currently only supports Gocr
Ruby
6
star
24

remarkable_extensions

Collection of unofficial Remarkable matchers
Ruby
5
star
25

liquid4j

Liquid on the Java plataform
Java
5
star
26

rspec-vraptor

RSpec's official VRaptor plugin
Ruby
4
star
27

remarkable_plugin

A Remarkable plugin generator
Ruby
4
star
28

j6

Like a G6 jQuery helpers
JavaScript
3
star
29

remarkable_you_name_it

Basic plugin structure for your custom Remarkable matchers
Ruby
3
star
30

hackerrank

Maintained Ruby wrapper to the HackerRank API
Ruby
3
star
31

will_paginate_latests

Rails plugin that paginates a model in a descendant order and works with i18n in the view
Ruby
3
star
32

vraptor2_sexy_urls

Sexy URLs in VRaptor
Java
2
star
33

haml4j_demo_app

A Java web application demo using Haml4j in the view and VRaptor Sexy Urls as the controller
Java
2
star
34

rhyme

A Java to Ruby objects translator
Ruby
2
star
35

railersbr

"We don't develop our system in Rails because there aren't enough railers in Brasil", you're wrong.
Ruby
2
star
36

iceproject

Rails Rumble "Simulation" project
Ruby
2
star
37

my_ldap_authenticator

A simple LDAP authenticator for simple LDAP servers
Ruby
2
star
38

lunr

Not-enterprise search platform
Ruby
2
star
39

ssophia

A SSO written in top of Devise/Rails
Ruby
2
star
40

dynamic_error_pages

Rails Dynamic Error Pages
Ruby
2
star
41

signal-auth

A plugin for Signal that adds authentication
Ruby
2
star
42

shoutt

Ruby
2
star
43

rails_reports

Ruby
1
star
44

acts_as_solr_reloaded_demo

ActsAsSolrReloaded Demo
Ruby
1
star
45

rails-rspec-matchers

Ruby
1
star
46

remarkable_friendly_id

A remarkable matcher for friendly_id
Ruby
1
star
47

sunspot-solr-server

1
star
48

remarkable_activerecord

Ruby
1
star
49

mysql-statsd

Send data to Statsd from MySQL
Ruby
1
star
50

ruqa

Ruby Query A... (I'm looking the meaning for the A)
Ruby
1
star
51

brasil.com

Ruby
1
star
52

remarkable_liquid

Remarkable Liquid Matchers
Ruby
1
star
53

active_lunr

Lunr plugin for Rails
Ruby
1
star