Created
October 8, 2010 17:52
-
-
Save smathy/617207 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
project = ARGV.shift or raise "Project not provided" | |
require 'rubygems' | |
gem 'rails', '<3' | |
gem 'lighthouse-api', '<2' | |
require 'lighthouse' | |
lh_api = "c969b955085e607c2450a58a0f3cde66be4f7c5f"; | |
Lighthouse.account = 'amco' | |
Lighthouse.token = lh_api | |
projects = { :ao => 38551, :aw => 38553, :lt => 38555, :th => 38554, :se => 38556, :ops => 40578 } | |
tickets = ARGV | |
tickets.uniq.each do |id| | |
t = Lighthouse::Ticket.find( id.to_i, :params => { :project_id => projects[project.to_sym] } ) | |
if t.state == 'live' or t.state == 'invalid' or t.state == 'future' | |
puts "#{t.id} => #{t.state}" | |
else | |
tag = "@#{ENV['TAG']}" | |
if t.tags.include? tag | |
t.body = "Deployed to production." | |
t.state = 'live' | |
else | |
t.tags << tag | |
end | |
t.save | |
end | |
end | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment