Sha256: dedf9b0da66c91a529fd9a8de292d6b7c7a55e3d8d58d29b385d98435c2071f2

Contents?: true

Size: 1.55 KB

Versions: 13

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/env ruby

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

is_quiet = ARGV.delete("--quiet") || ARGV.delete("-q")

run_cmd 'git checkout master'
run_cmd 'git pull'
run_cmd 'git pull origin last_known_good_staging'
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?
  HighLine.say "\n<%= color('The following tickets do NOT have a git branch properly configured:', :red) %>"
  issues_with_no_branch.each do |issue|
    print_issue issue
  end
end

branches.each do |branch|
  HighLine.say "\nThe changes on branch <%= color('#{branch}', :green) %> "
  if branches(:merged => true, :remote => true).include?(branch)
    HighLine.say "<%= color('HAVE', :green) %> been merged into master"
    releasable_tickets = tickets_from_branch(branch).select do |issue|
      print_issue issue
      HighLine.agree("Mark this issue as released? (y/n)")
    end
    release_tickets releasable_tickets
  else
    HighLine.say "<%= color('HAVE NOT', :red) %> been merged into master"
  end
end

run_cmd 'git prune-merged -r'

run_cmd "socialcast share '#worklog releasing staging branch to production #scgitx'" unless is_quiet

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
socialcast-git-extensions-2.0.8 bin/git-release-staging
socialcast-git-extensions-2.0.7 bin/git-release-staging
socialcast-git-extensions-2.0.6 bin/git-release-staging
socialcast-git-extensions-2.0.5 bin/git-release-staging
socialcast-git-extensions-2.0.4 bin/git-release-staging
socialcast-git-extensions-2.0.3 bin/git-release-staging
socialcast-git-extensions-2.0.2 bin/git-release-staging
socialcast-git-extensions-2.0.1 bin/git-release-staging
socialcast-git-extensions-2.0.0 bin/git-release-staging
socialcast-git-extensions-2.0.0.beta4 bin/git-release-staging
socialcast-git-extensions-2.0.0.beta3 bin/git-release-staging
socialcast-git-extensions-2.0.0.beta2 bin/git-release-staging
socialcast-git-extensions-2.0.0.beta1 bin/git-release-staging