These are some useful git commands for implementing this in your own deployment setup.
Detecting if we're running on a clean checkout:
- git fetch
- git diff --shortstat [branch]
Determining if there are pending migrations:
| class CompressedRequests | |
| def initialize(app) | |
| @app = app | |
| end | |
| def method_handled?(env) | |
| !!(env['REQUEST_METHOD'] =~ /(POST|PUT)/) | |
| end | |
| def encoding_handled?(env) |
| Host * | |
| ForwardAgent yes | |
| ProxyCommand ~/bin/ssh-proxy.sh %h %p username@jump-host | |
| ServerAliveInterval 10 | |
| ServerAliveCountMax 600 |
| Host * | |
| ServerAliveInterval 10 | |
| ServerAliveCountMax 600 |
| class CaptureIO | |
| # Coffeescript port of: https://gist.github.com/729616 | |
| # | |
| # Usage: | |
| # test = new CaptureIO() | |
| # unhook = test.hookStdout((string, encoding, fd) -> | |
| # util.debug('stdout: ' + util.inspect(string)) | |
| # ) | |
| # Restoring stdout: |
| # Simple, scrappy UDP DNS server in Ruby (with protocol annotations) | |
| # By Peter Cooper | |
| # Ruby 1.8.7/MagLev version by Karl Matthias | |
| # | |
| # MIT license | |
| # | |
| # * Not advised to use in your production environment! ;-) | |
| # * Supports A and CNAME records | |
| # * See http://www.ietf.org/rfc/rfc1035.txt for protocol guidance | |
| # * All records get the same TTL |
| #!/usr/bin/env ruby | |
| COLUMNS_TO_USE = 40.0 | |
| histo = [] | |
| 0.upto(9) { |i| histo[i] = 0 } | |
| field_to_parse = ARGV.shift.to_i | |
| ARGF.each do |line| | |
| fields = line.split(/,/) |
| class Mydrive < RTanque::Bot::Brain | |
| NAME = 'mydrive' | |
| include RTanque::Bot::BrainHelper | |
| CORNERS = [:NW, :NE, :SE, :SW] | |
| TURRET_FIRE_RANGE = RTanque::Heading::ONE_DEGREE * 1.0 | |
| def tick! | |
| self.hide_in_corners | |
| if (target = self.acquire_target) |
| #!/bin/bash | |
| # | |
| # memtest | |
| # | |
| # A general purpose memory tester script, with options for enabling extra | |
| # simultaneous tests in an attempt to test the capacity of the power supply | |
| # in the machine. You can find the original source of this script and | |
| # additional documentation on its usage by visiting my work web page at | |
| # http://people.redhat.com/~dledford/ | |
| # |
| # bash-completion for the upstart event-based init replacement | |
| # (http://upstart.ubuntu.com / https://launchpad.net/upstart) | |
| # | |
| # We don't provide completion for 'init' itself for obvious reasons. | |
| # Original is from: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/672067/+attachment/1765103/+files/upstart.sh | |
| _upstart_conf_events() | |
| { | |
| initctl list|awk '{print $1}' |