#!/usr/bin/env ruby require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb') require 'readline' include Socialcast branch = current_branch raise "Cannot release reserved branch" if %w{master staging}.include?(branch) ticket = ARGV.shift raise 'JIRA ticket is required in order to release this branch' unless ticket exit unless Readline.readline("This will release #{branch} to production. Are you sure (y/n)? ") == 'y' update branch integrate branch, 'master' update_ticket ticket, {:branch => branch} release_ticket ticket run_cmd "git integrate #{ticket}" run_cmd "grb rm #{branch}"