#!/usr/bin/env ruby require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb') include Socialcast branch = current_branch abort("Cannot release reserved branch") if %w{master staging prototype}.include?(branch) is_quiet = ARGV.delete("--quiet") || ARGV.delete("-q") tickets = tickets_from_arguments_or_branch(ARGV, branch) exit unless HighLine.agree("<%= color('Release #{branch} to production? (y/n)', :green) %>") run_cmd 'git update' integrate branch, 'master' if tickets.any? update_tickets tickets, :branch => branch release_tickets tickets end integrate branch, 'staging' integrate 'staging', 'prototype' run_cmd "git checkout master" run_cmd "grb rm #{branch}" run_cmd "socialcast share '#worklog releasing #{branch} to production #scgitx'" unless is_quiet