Sha256: b263198940fdf032bca8b154828d0b24d209a68126255f77479eca28e63c02b1

Contents?: true

Size: 1.38 KB

Versions: 5

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby

require File.join(File.dirname(__FILE__), '..', 'lib', 'socialcast-git-extensions.rb')
require 'readline'
include Socialcast

run_cmd 'git checkout master'
run_cmd 'git pull'
run_cmd 'git pull origin last_known_good_next_release'
run_cmd 'git push origin HEAD'

filter_id = '10102'
issues = jira_server.getIssuesFromFilterWithLimit filter_id, 0, 1000
branches = issues.collect do |issue|
  field = issue.customFieldValues.detect {|k| k.customfieldId == GIT_BRANCH_FIELD }
  field ? field.values.first : nil
end.uniq.compact

issues_with_no_branch = issues.reject do |issue| 
  issue.customFieldValues.detect {|k| k.customfieldId == GIT_BRANCH_FIELD }
end
if issues_with_no_branch.any?
  puts "\n\nThe following tickets do not have a git branch configured:"
  issues_with_no_branch.each do |issue|
    puts "#{issue.key} - #{issue.summary}"
  end
end

branches.each do |branch|
  puts "\n\nChecking state of branch #{branch}:"
  if branches(:merged => true, :remote => true).include?(branch)
    puts "All changes in #{branch} have been merged into master"
    releasable_tickets = tickets_from_branch(branch).select do |issue|
      puts "#{issue.key} - #{issue.summary}"
      Readline.readline("Mark this issue as released? (y/n)? ") == 'y'
    end
    release_tickets releasable_tickets
  else
    puts "#{branch} has NOT yet been merged into master"
  end
end

run_cmd 'git prune-merged -r'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
socialcast-git-extensions-1.3.1 bin/git-release-pending
socialcast-git-extensions-1.3.0 bin/git-release-pending
socialcast-git-extensions-1.2.0 bin/git-release-pending
socialcast-git-extensions-1.1.0 bin/git-release-pending
socialcast-git-extensions-1.0.0 bin/git-release-pending