Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Deliver stories script for pivotaltracker
#!/usr/bin/env ruby
# gem 'pivotal-tracker'
require 'pivotal-tracker'
PivotalTracker::Client.token = TRACKER_TOKEN
PivotalTracker::Client.use_ssl = true
unpakt_project = PivotalTracker::Project.find(TRACKER_PROJECT_ID)
stories = unpakt_project.stories.all(:state => "finished", :story_type => ['bug', 'feature'])
staging_deploy_tag = `git tag | grep staging | tail -n1`
stories.each do | story |
puts "Searching for #{} in local git repo."
search_result = `git log --grep #{} #{staging_deploy_tag}`
if search_result.length > 0
puts "Found #{}, marking as delivered."
story.notes.create(:text => "Delivered by staging deploy script.")
story.update({"current_state" => "delivered"})
puts "Coult not find #{} in git repo."
# Using the pivotal-tracker gem (,
# the script finds all Finished stories in your Tracker project,
# and looks for a commit in the git log with that Story ID.
# If it finds one, it marks the story as Delivered.
# It also adds a note to the story
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment