releasecop 0.0.13 → 0.0.16

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
  SHA256:
3
- metadata.gz: acbb3de308ca2133630425cc039aa7dde8115aa91b89b2c299bd8f8cc12b018b
4
- data.tar.gz: 179650ad314f35f899824cecd2a6c4f77650dc012717336722bac0675f0acc0c
3
+ metadata.gz: 688d27f9f3caa8116455a3a9efa09907995143c815c78c242291fb2213414c83
4
+ data.tar.gz: f70f81672b5436f91e48eac60d65ce3a14a182a451f37ab53634613f7788b1fe
5
5
  SHA512:
6
- metadata.gz: 86c215ffcf3846120061fb3698f46e314ab4cdd1f8beaf25a2e75c7f45e34597bdc51aadc4ccb9afd394168d66960fd86cc296227d31f2b09d3ea4365aacf385
7
- data.tar.gz: afa204f77d712debbe88ddc59335d6bd5eb9fd401abacc57071a0b024a8b3174de854d5602bab031b427f12fee5756bb06a07abab04c166fdfd743ffe4d8830d
6
+ metadata.gz: 8a2db437039bf5d9428743adc2aa818bfe3f65e37836b206aeb0d04f0a4b18dda5f6be76a1b1c0378d6c89b9a0ed6efc3a7e01144f53c30535f4109de7d6c0d2
7
+ data.tar.gz: f39a326831ef4f38b54e5c5b9bc001ec109e8df49d2678986d33e103926da8319fbe2439d5f5479971892a1e86f1410e574cb2647155f587c52a16f79354bcfc
data/CHANGELOG.md CHANGED
@@ -2,6 +2,19 @@
2
2
  ------------
3
3
  * Your contribution here...
4
4
 
5
+ 0.0.16 (2022-07-27)
6
+ ------------
7
+ * Update README to document both master and main branch approaches.
8
+ * Require fileutils (fixes uninitialized constant Releasecop::Cli::FileUtils (NameError))
9
+
10
+ 0.0.15 (2019-04-05)
11
+ ---
12
+ * Update for compatibility with hokusai >=0.5.4 (now incompatible with earlier versions) (57ee7ae56)
13
+
14
+ 0.0.14 (2019-01-07)
15
+ ---
16
+ * Fix `tag_pattern`-matching to respect annotated tags (c7eda3599)
17
+
5
18
  0.0.13 (2018-11-15)
6
19
  ---
7
20
  * Add email to diff output (081d270)
data/README.md CHANGED
@@ -22,8 +22,8 @@ In the manifest, each project lists the environments to which code is deployed _
22
22
  {"name": "production", "git": "git@heroku.com:charge-production.git"}
23
23
  ],
24
24
  "heat": [
25
- {"name": "master", "git": "git@github.com:artsy/heat.git"},
26
- {"name": "master-succeeded", "git": "git@github.com:artsy/heat.git", "branch": "master-succeeded"},
25
+ {"name": "main", "git": "git@github.com:artsy/heat.git", "branch": "main"},
26
+ {"name": "succeeded", "git": "git@github.com:artsy/heat.git", "branch": "succeeded"},
27
27
  {"name": "production", "git": "git@github.com:artsy/heat.git", "branch": "production"}
28
28
  ]
29
29
  }
@@ -39,8 +39,8 @@ Example output:
39
39
  staging is up-to-date with master
40
40
  production is up-to-date with staging
41
41
  heat...
42
- master-succeeded is up-to-date with master
43
- production is behind master-succeeded by:
42
+ succeeded is up-to-date with main
43
+ production is behind succeeded by:
44
44
  4557f60 2015-03-24 Upgrade to 3.9 (timsmith)
45
45
  f33acc4 2015-03-25 Add support for avatars (janeR)
46
46
  2 project(s) checked. 1 environment(s) out-of-date.
@@ -76,7 +76,7 @@ Many teams create git tags corresponding to each milestone or release. The `tag_
76
76
  ```json
77
77
  {
78
78
  "causality": [
79
- {"name": "master", "git": "git@github.com:artsy/causality.git" },
79
+ {"name": "main", "git": "git@github.com:artsy/causality.git", "branch": "main" },
80
80
  {"name": "staging", "git": "git@github.com:artsy/causality.git", "tag_pattern": "staging-*"},
81
81
  {"name": "production", "git": "git@github.com:artsy/causality.git", "tag_pattern": "release-*"}
82
82
  ]
@@ -85,5 +85,8 @@ Many teams create git tags corresponding to each milestone or release. The `tag_
85
85
 
86
86
  The most recent commit matching each tag expression is presumed to correspond with the state of each environment. Tag patterns follow `git` conventions, so, e.g., `staging-*` will be treated as `/refs/tags/staging-*`.
87
87
 
88
+ ### A note about default branch names
89
+
90
+ For backwards compatibility, `releasecop` assumes a default branch name of `master`. To override this behavior, set the `RELEASECOP_DEFAULT_BRANCH` environment variable (to e.g. `main`).
88
91
 
89
92
  Copyright (c) 2015-2018 Joey Aghion, Artsy
@@ -2,6 +2,8 @@ module Releasecop
2
2
  class Comparison
3
3
  attr_accessor :lines, :behind, :ahead
4
4
 
5
+ PRETTY_FORMAT = '%h %ad %s (%an, %ae)'
6
+
5
7
  def initialize(ahead, behind)
6
8
  @ahead = ahead
7
9
  @behind = behind
@@ -18,7 +20,7 @@ module Releasecop
18
20
  private
19
21
 
20
22
  def log
21
- `git log #{@behind.for_rev_range}..#{@ahead.for_rev_range} --pretty=format:"%h %ad %s (%an, %ae)" --date=short --no-merges`
23
+ `git log #{@behind.for_rev_range}..#{@ahead.for_rev_range} --pretty=format:"#{PRETTY_FORMAT}" --date=short --no-merges`
22
24
  end
23
25
  end
24
26
  end
@@ -7,7 +7,7 @@ module Releasecop
7
7
  @repo_name = repo_name
8
8
  @git = item['git']
9
9
  @name = item['name']
10
- @branch = item['branch'] || 'master'
10
+ @branch = item['branch'] || ENV['RELEASECOP_DEFAULT_BRANCH'] || 'master'
11
11
  @options = item.select { |k, _v| OPTION_KEYS.include?(k) }
12
12
  end
13
13
 
@@ -24,13 +24,15 @@ module Releasecop
24
24
  private
25
25
 
26
26
  def find_hokusai_sha
27
- images_output = with_aws_env { `hokusai registry images` }
28
- tags = images_output.lines.grep(/\d{4}.* | .* | .*/).map{|l| l.split(' | ').last.split(',').map(&:strip)}
29
- tags.detect{|t| t.include?(@options['hokusai']) }.detect{|t| t[/^[0-9a-f]{40}$/]}
27
+ images_output = with_aws_env { `hokusai registry images --limit 1000` } # list as many items as possible
28
+ tags = images_output.lines.grep(/\d{4}.* \| .*/).map do |l| # lines listing images
29
+ l.split(' | ').last.gsub(/\e\[(\d+)(\;\d+)*m/, '').split(',').map(&:strip) # tags
30
+ end
31
+ tags.detect{|t| t.include?(@options['hokusai']) }.detect{|t| t[/^[0-9a-f]{40}$/]} # first SHA-seeming tag matching environment
30
32
  end
31
33
 
32
34
  def find_tag_pattern_sha
33
- `git for-each-ref --format='%(objectname)' --count=1 --sort=-authordate --sort=-committerdate 'refs/tags/#{@options['tag_pattern']}'`.strip
35
+ `git for-each-ref --format='%(objectname)' --count=1 --sort=-authordate --sort=-committerdate --sort=-creatordate 'refs/tags/#{@options['tag_pattern']}'`.strip
34
36
  end
35
37
 
36
38
  # not thread-safe
@@ -1,3 +1,3 @@
1
1
  module Releasecop
2
- VERSION = "0.0.13"
2
+ VERSION = "0.0.16"
3
3
  end
data/lib/releasecop.rb CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  require "releasecop/version"
2
3
  require 'thor'
3
4
  require 'shellwords'
@@ -6,6 +7,7 @@ require 'releasecop/manifest_item'
6
7
  require "releasecop/comparison"
7
8
  require "releasecop/result"
8
9
  require "releasecop/checker"
10
+ require 'fileutils'
9
11
  require "releasecop/cli"
10
12
 
11
13
  module Releasecop
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releasecop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Aghion
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-15 00:00:00.000000000 Z
11
+ date: 2022-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description:
69
+ description:
70
70
  email:
71
71
  - joey@aghion.com
72
72
  executables:
@@ -93,7 +93,7 @@ homepage: https://github.com/joeyAghion/releasecop
93
93
  licenses:
94
94
  - MIT
95
95
  metadata: {}
96
- post_install_message:
96
+ post_install_message:
97
97
  rdoc_options: []
98
98
  require_paths:
99
99
  - lib
@@ -108,9 +108,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.7.6
113
- signing_key:
111
+ rubygems_version: 3.3.14
112
+ signing_key:
114
113
  specification_version: 4
115
114
  summary: Given a list of projects and environments pipelines, report which environments
116
115
  are "behind" and by which commits.