• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Ruby
  • Created about 16 years ago
  • Updated over 15 years ago

Reviews

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

Repository Details

Deploy Rails applications automatically by running Capistrano tasks with Git post-commit hooks

Pushr

Deploy Rails applications by Github Post-Receive URLs launching Capistrano’s tasks (cap deploy, cap staging deploy) or by pushing button in web GUI and get notifications by Twitter, IRC or Jabber.

Why? Because my friend Machal still cannot fix Capistrano on his Windows box and can now deploy with GitGUI. (No need to launch “DOS” for him when only thing he did is fixing some CSS or updating some assets.)

Currently runs deployment for about 5 Rails apps.

What?

Pushr assumes this:

  • You deploy a Rails application with Capistrano in standard settings

  • You have a “deploy” branch in your repo, which you deploy on production (and possibly deploy “master” on staging)

  • You have installed Capistrano et al. on the server you are deploying

  • You have a deploy.rb in your repository (and use SSH keys! you should!) or symlink deploy.rb

  • You are willing and able to run a Ruby application open to teh internet on the same machine as your Rails application

  • You are not anxiously awaiting how the cap deploy task ends. You just check the results from time to time.

  • You have tests for your application and you run them in Capistrano before hook (so you don’t end up deploying breakz)

  • You have set a post-receive hook for your repository, calling specific URL. See section below for Github guide.

Pushr calls Capistrano’s deploy task specified in config.yml (or deploy:migrations by default) whenever you push to the repository with the hook.

You can also deploy by literally pushing a button in Pushr’s web-interface.

Pushr logs the Capistrano output into a file and updates status for configured Twitter account (the default notification).

You can setup more notifiers in config.yml file. Currently these are provided:

You can easily add more notifiers: they are modeled after Ingerity notifiers (integrityapp.com/notifiers), so it would be very, very easy to adapt those.

Want to try it out?

Install or update following Rubygems on the local machine or server where you want to run it:

$ sudo gem install sinatra rack haml capistrano capistrano-ext thin

Rename and edit the configuration file:

$ cp config.example.yml config.yml
$ vim config.yml

Run the app in development mode:

rake

Set up *Github Post-Receive URL* (github.com/guides/post-receive-hooks) in your repo’s administration to:

http://{USERNAME SET IN CONFIG}:{PASSWORD SET IN CONFIG}@{YOUR SERVER}:4000

Load the URL in the browser. Fill the ugly HTTP-Auth box with the credentials from config.yml. You should see some info about deployed revision.

Click “Test Hook” at Github or do a git push to the git repo. You should see something POSTed in your terminal. Your application is updated with Capistrano. Done.

(Of course, you can use Git’s post-receive hook in any repo, not just on Github. You would be curl-ing that URL or something like that then.)

If you’re satisfied with what you see, you should run and control Pushr backed-up with Thin by rake start/rake stop.

Follow Twitter username you set in config.yml on Twitter for notifications. Run tail -f deploy.log to see what’s really going on.

NOTE: Notifiers would require more gems, obviously, such as Jabber would require the xmppr gem.

You can use Pushr without Github, obviously: you just need to setup a post-receive hook in your .git/hooks/post-receive with curl or something like that.

More information

Get more information in these articles:

Todos

  • Disable deploy with ‘[nodeploy]` declaration in commit message

  • !

    Visualize deploy.log on webpage in a sparkline graph (succeeded/failed deploys, show relevant portion of deploy.log for each deploy, etc)

More Repositories

1

retire

A rich Ruby API and DSL for the Elasticsearch search engine
Ruby
1,870
star
2

elasticsearch-paramedic

A simple tool to inspect the state and statistics about ElasticSearch clusters
JavaScript
664
star
3

marley

Minimalist blogging engine without textareas based on Markdown, Ruby, Sinatra and Git push hooks
Ruby
246
star
4

monittr

Ruby and web interface for Monit statistics
Ruby
237
star
5

localized_country_select

Rails plugin for localized "country_select" helper with Rake task for downloading locales from Unicode.org's CLDR
Ruby
180
star
6

ember-data-elasticsearch

elasticsearch adapter for Ember Data
JavaScript
94
star
7

rails-deployment-setups-sprinkle

Collection of recipes for various Ruby On Rails deployment setups
Ruby
69
star
8

tire-contrib

Additions and extensions for the Tire gem
Ruby
65
star
9

chef-hello-cloud

A demo of a full stack Rails application deployment (1x load balancer, 3x appserver, 1x database, 3x elasticsearch) with Chef Server
Ruby
59
star
10

visualizing-couchdb-changes-with-node-js

An experiment in basic real-time visualization of CouchDB _changes stream with Node.js and Socket.IO
JavaScript
32
star
11

chef-solo-hello-world

A tutorial for Chef Solo
Ruby
31
star
12

yaml_micro_chat

YAML based micro-chat in Sinatra framework for Ruby
Ruby
31
star
13

rails_i18n_demo_app

Demo for Rails 2.2 internationalization & localization features
Ruby
27
star
14

dotfiles

Vim Script
19
star
15

couchdb-showcase

A small application to demonstrate basic CouchDB features
JavaScript
18
star
16

clearance_http_auth

Simple, instant HTTP Basic Authentication for applications using Clearance
Ruby
16
star
17

redis_twitter_example

An executable tutorial showcasing Twitter “lookalike” in Redis for the Czech and Slovak PostgreSQL User Group talk
Shell
14
star
18

hide

Search for Jekyll websites
Ruby
13
star
19

sheep_in_your_shoes

A tutorial game in Shoes for teaching OOP
Ruby
12
star
20

sinatra_workshop_tutorials

Collection of small apps to demonstrate Sinatra micro-framework and it's stage
Ruby
10
star
21

workshop_tutorial_application

Tutorial Ruby on Rails application (similar to www.tadalist.com) coded live on workshops. Development steps can be reconstructed from commits.
Ruby
10
star
22

smokes

Tracking your nicotine intake with CouchDB and Protovis
JavaScript
9
star
23

colibriary

Demo application to show how to use Cucumber stories in Czech
Ruby
8
star
24

markout

Export sexy formatted documents with history from plain text files. Work in progress.
JavaScript
8
star
25

shoes_demonstration_apps

Collection of tiny apps to demonstrate Shoes GUI toolkit at lectures, user group meetings, etc
Ruby
7
star
26

elastic-stack-demo

Demo of the observability features of the Elastic Stack
Go
6
star
27

gotalks

JavaScript
5
star
28

es-rails-example

Demo for the Elasticsearch integration with Ruby On Rails (ElasticON 2016)
Ruby
5
star
29

wikipedia_history_viz

Ruby
5
star
30

elasticsearch_webexpo_demo

Demo of Distributed Features for Webexpo 2011
Ruby
4
star
31

resque-demo

A set of scripts to demonstrate the Resque framework for processing background jobs
Ruby
3
star
32

markout-tmbundle

Ruby
3
star
33

consolelog

A ConsoleWriter for rs/zerolog
Go
3
star
34

calculator

Calculator: example repository for Git workshops
JavaScript
2
star
35

tdd_tutorial_by_numbers

Test-Driven Development in Ruby by Numbers (tutorial)
Ruby
2
star
36

test_default_url_options

testing default_url_options in Rails
Ruby
2
star
37

bouncy_air

Just. Fooling. Around
ActionScript
2
star
38

dm-elasticsearch

Ruby
2
star
39

pushr_notifiers

Example of notification classes for Pushr. Heavily inspired by Integrity
Ruby
2
star
40

pushr_test_app

Just testing something :)
Ruby
1
star
41

wikipedia_metal_umlaut

1
star
42

webexpo_demo_app

Demonstrační aplikace pro přednášku na konferenci Webexpo
Ruby
1
star
43

tire_facet_filter_problem

Ruby
1
star
44

karmi.github.com

1
star
45

slingshot

Ruby client for ElasticSearch
1
star