Git Product home page Git Product logo

pushr's Introduction

Pushr

Deploy Rails applications by Github Post-Receive URLs launching Capistrano’s tasks (cap deploy, cap staging deploy)

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.)

Because it could be cool, what you think?

Obviously, do not use on mission critical deployments :)

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.

Currently it logs the output into a file and updates status for configured Twitter account. Other notifications? Sure, later.

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

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.

More information

Get more information in introductory post @ www.restafari.org/pushr-or-the-application-will-deploy-itself.html

Todos

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

  • Improve & separate Notifications (Twitter, e-mail, Jabber, …)

pushr's People

Contributors

karmi avatar

Stargazers

Angus H. avatar Scott Windsor avatar

Watchers

Scott Windsor avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.