releasecop 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/README.md +8 -0
- data/lib/releasecop/manifest_item.rb +15 -2
- data/lib/releasecop/version.rb +1 -1
- data/lib/releasecop.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e67b286ebaca81d5f18df0fa1a22434288d31149aa015dfa5f5a862ca7d46a41
|
|
4
|
+
data.tar.gz: ca42df31717398673e2df330b5d98152379a309c8fd6c761c0e6af341436ab38
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4eb0cfface184b1789c90487ecc269c9883aa99f641225b516b9b4b5c94e2cb95540c940389b90b16d5dfa9dcf555ce773dd69b4c2a11558b7d43269a59ba6d5
|
|
7
|
+
data.tar.gz: affe10bd19328c250a3746e7eea0e36fed6f71ac4dca8963404843914db2d0135dd2b4714ecdf37371d8fee72bfe09d6cc399ad272d3f007e281accd45d69c30
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -69,6 +69,14 @@ At this time releasecop is not compatible with projects using [Heroku Pipelines]
|
|
|
69
69
|
|
|
70
70
|
Releasecop will determine the git SHAs corresponding with each pipeline stage via the `hokusai registry images` command.
|
|
71
71
|
|
|
72
|
+
If the project's hokusai configuration doesn't live at the top level of the repo (e.g., in a monorepo), add a `path` property with the subdirectory containing its `hokusai/` directory. `hokusai` commands will be run from there:
|
|
73
|
+
|
|
74
|
+
```json
|
|
75
|
+
{"name": "production", "git": "git@github.com:artsy/artsy-agent.git", "hokusai": "production", "path": "apps/agent-web"}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Note that `path` only affects where hokusai is run; comparisons still cover every commit in the repo.
|
|
79
|
+
|
|
72
80
|
### Tagged Releases
|
|
73
81
|
|
|
74
82
|
Many teams create git tags corresponding to each milestone or release. The `tag_pattern` property can be used to match sets of tags corresponding to an environment. E.g.:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Releasecop
|
|
2
2
|
class ManifestItem
|
|
3
|
-
OPTION_KEYS = %w[hokusai tag_pattern aws_access_key_id aws_secret_access_key]
|
|
3
|
+
OPTION_KEYS = %w[hokusai path tag_pattern aws_access_key_id aws_secret_access_key]
|
|
4
4
|
attr_reader :git, :branch, :name
|
|
5
5
|
|
|
6
6
|
def initialize(repo_name, item)
|
|
@@ -24,13 +24,26 @@ module Releasecop
|
|
|
24
24
|
private
|
|
25
25
|
|
|
26
26
|
def find_hokusai_sha
|
|
27
|
-
images_output = with_aws_env { `hokusai registry images --limit 1000` } # list as many items as possible
|
|
27
|
+
images_output = in_path { with_aws_env { `hokusai registry images --limit 1000` } } # list as many items as possible
|
|
28
28
|
tags = images_output.lines.grep(/\d{4}.* \| .*/).map do |l| # lines listing images
|
|
29
29
|
l.split(' | ').last.gsub(/\e\[(\d+)(\;\d+)*m/, '').split(',').map(&:strip) # tags
|
|
30
30
|
end
|
|
31
31
|
tags.detect{|t| t.include?(@options['hokusai']) }.detect{|t| t[/^[0-9a-f]{40}$/]} # first SHA-seeming tag matching environment
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
# Runs the block in the configured subdirectory of the repo (where the project's hokusai/ config lives), if any.
|
|
35
|
+
def in_path(&block)
|
|
36
|
+
path = @options['path'].to_s
|
|
37
|
+
return yield if path.empty? || path == '.'
|
|
38
|
+
|
|
39
|
+
if Pathname.new(path).absolute? || Pathname.new(path).cleanpath.each_filename.include?('..')
|
|
40
|
+
raise ArgumentError, "path must be relative to the repo root: #{path}"
|
|
41
|
+
end
|
|
42
|
+
raise ArgumentError, "path not found in #{@repo_name} repo: #{path}" unless File.directory?(path)
|
|
43
|
+
|
|
44
|
+
Dir.chdir(path, &block)
|
|
45
|
+
end
|
|
46
|
+
|
|
34
47
|
def find_tag_pattern_sha
|
|
35
48
|
`git for-each-ref --format='%(objectname)' --count=1 --sort=-authordate --sort=-committerdate --sort=-creatordate 'refs/tags/#{@options['tag_pattern']}'`.strip
|
|
36
49
|
end
|
data/lib/releasecop/version.rb
CHANGED
data/lib/releasecop.rb
CHANGED
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.
|
|
4
|
+
version: 0.0.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Joey Aghion
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
109
|
version: '0'
|
|
110
110
|
requirements: []
|
|
111
|
-
rubygems_version: 3.
|
|
111
|
+
rubygems_version: 3.4.19
|
|
112
112
|
signing_key:
|
|
113
113
|
specification_version: 4
|
|
114
114
|
summary: Given a list of projects and environments pipelines, report which environments
|