heroku_deployer 0.7.10 → 0.7.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf46a1d4195720d38e9ed25531f209843c48901f
4
- data.tar.gz: 422d9f49e108e016e7a3349bb016c6706c1ed6d0
3
+ metadata.gz: 984d7cbc5fde7f4340daaa9f049072b721c9e2c7
4
+ data.tar.gz: 9477d80aedeb32654ae09c9b57bacb69093cd559
5
5
  SHA512:
6
- metadata.gz: 73d79b720e4b7ecc65cbb7451cf3dc8a07033e3f121ed5de6f1043739f8e48a27999a3cf38d7b31e98e79a726a3dd21fc431d36ff16e9f566f63ed88533830f4
7
- data.tar.gz: 9361adf4789b1294dc512cbbbd11eea6206639c8694a8f035eb844b7482327fc0ca84626a3c6864997121f15b9a84d1efd4e46d9037df86f379e3e937ce7eb13
6
+ metadata.gz: 2f04ca2c0c3e250b8542a0ec04524bb5add5b27a86eb972f23e0acc79ba54aef2cec9475caecf1ae3e3c8db1beb272648704da53b498f761a01b99b28bbaca73
7
+ data.tar.gz: 11d2338360486ce90fbd41065e6b86e398938da12abb8537c80dd5d9524097e726723096ca9ef05df269213dd7fbd9c1e0cdf878165db9b97c37000b21a27b6e
@@ -44,7 +44,8 @@ module Amitree
44
44
  release['description'] =~ @promoted_release_regexp
45
45
  end
46
46
 
47
- def staging_releases_since(staging_release_version)
47
+ def staging_releases_since(production_release)
48
+ staging_release_version = self.staging_release_version(production_release)
48
49
  staging_releases = get_releases(@staging_app_name)
49
50
  index = staging_releases.index { |release| release['version'] == staging_release_version }
50
51
  if index.nil?
@@ -53,7 +54,8 @@ module Amitree
53
54
  staging_releases.slice(index+1, staging_releases.length)
54
55
  end
55
56
 
56
- def deploy_to_production(staging_release_version, options={})
57
+ def deploy_to_production(staging_release, options={})
58
+ staging_release_version = staging_release['version']
57
59
  slug = staging_slug(staging_release_version)
58
60
  puts "Deploying slug to production: #{slug}"
59
61
  unless options[:dry_run]
@@ -84,6 +86,10 @@ module Amitree
84
86
  end
85
87
  end
86
88
 
89
+ def version(release)
90
+ "v#{release['version']}"
91
+ end
92
+
87
93
  private
88
94
  def get_releases(app_name)
89
95
  # Use our own cache because of https://github.com/heroku/platform-api/issues/16
@@ -7,16 +7,11 @@ module Amitree
7
7
  class HerokuDeployer
8
8
  class ReleaseDetails
9
9
  attr_accessor :production_release, :staging_release_to_deploy, :stories
10
- attr_writer :production_promoted_from_staging
11
10
 
12
11
  def initialize
13
12
  @stories = []
14
13
  end
15
14
 
16
- def production_promoted_from_staging?
17
- @production_promoted_from_staging
18
- end
19
-
20
15
  class Story < DelegateClass(PivotalTracker::Story)
21
16
  attr_accessor :deliverable
22
17
  attr_reader :blocked_by
@@ -50,8 +45,7 @@ module Amitree
50
45
  result = ReleaseDetails.new
51
46
 
52
47
  result.production_release = @heroku.last_promoted_production_release
53
- result.production_promoted_from_staging = @heroku.promoted_from_staging?(result.production_release)
54
- staging_releases = @heroku.staging_releases_since(@heroku.staging_release_version(result.production_release))
48
+ staging_releases = @heroku.staging_releases_since(result.production_release)
55
49
 
56
50
  prod_commit = @heroku.get_production_commit(result.production_release)
57
51
  puts "Production release is #{prod_commit}" if options[:verbose]
@@ -64,7 +58,7 @@ module Amitree
64
58
  stories = all_stories.values_at(*@git.stories_worked_on_between(prod_commit, staging_commit)).compact
65
59
  story_ids = stories.map(&:id)
66
60
 
67
- puts "- Trying staging release v#{staging_release['version']} with commit #{staging_commit}" if options[:verbose]
61
+ puts "- Trying staging release #{@heroku.version(staging_release)} with commit #{staging_commit}" if options[:verbose]
68
62
  puts " - Stories: #{story_ids.inspect}" if options[:verbose]
69
63
 
70
64
  unaccepted_story_ids = story_ids.select { |story_id| get_tracker_status(story_id) != 'accepted' }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heroku_deployer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.10
4
+ version: 0.7.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Wargnier
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-23 00:00:00.000000000 Z
12
+ date: 2016-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec