retag 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/retag +29 -5
- data/lib/retag/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f11b13578478be3507e9a47f1a011f12cd5ba25a751b3fc84304685c1203f8b0
|
4
|
+
data.tar.gz: f48c1d71d7376ce8aaee00c3f5f8191c0dcc040f660fce1edb73f3c1a3fe6495
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e11360d25de512b9d78feb6fdb0ae3157a05cb75ab02abdb064b5d4616cef46714782b787134ea3a15d529094b22bd5f785b38a82f3af0245bb47438d13ac86
|
7
|
+
data.tar.gz: e505928a71af0331668c835e7c14d7d1b4c9b32a6b9f2072cb1b3e6b75550ac70af526c325027824741ff9e97024bf3555e3a0ad1af1a4e94037b954a84437d7
|
data/Gemfile.lock
CHANGED
data/bin/retag
CHANGED
@@ -41,6 +41,10 @@ class RepoCommand < Thor
|
|
41
41
|
# Success: there is no such tag
|
42
42
|
end if opts['force']
|
43
43
|
|
44
|
+
$logger.info ">>> Repo #{project}"
|
45
|
+
$logger.info " From ".ljust(5) + "[#{options['ref'].colorize(:yellow)}]".ljust(35)
|
46
|
+
$logger.info " To ".ljust(5) + "[#{tag.colorize(:yellow)}]".ljust(35)
|
47
|
+
|
44
48
|
puts Gitlab.client.create_tag(project, tag, options['ref'], options['message']).inspect
|
45
49
|
end
|
46
50
|
|
@@ -57,7 +61,10 @@ class RepoCommand < Thor
|
|
57
61
|
type: :string,
|
58
62
|
desc: "description Markdown"
|
59
63
|
def release(project, tag)
|
60
|
-
|
64
|
+
$logger.info ">>> Repo #{project}"
|
65
|
+
$logger.info " From ".ljust(5) + "[#{options['ref'].colorize(:yellow)}]".ljust(35)
|
66
|
+
$logger.info " To ".ljust(5) + "[#{tag.colorize(:yellow)}]".ljust(35)
|
67
|
+
Gitlab.client.create_project_release(project, name: tag, tag_name: tag, description: options['description']&.strip, ref: options['ref'])
|
61
68
|
end
|
62
69
|
end
|
63
70
|
|
@@ -90,7 +97,11 @@ class DockerCommand < Thor
|
|
90
97
|
tag = opts['suffix'].present? ? "#{tag}-#{opts['suffix']}" : tag
|
91
98
|
|
92
99
|
image = ::Retag::Image.new(img, tag)
|
93
|
-
|
100
|
+
|
101
|
+
$logger.info ">>> Image #{img.image}"
|
102
|
+
$logger.info " From ".ljust(5) + "[#{image.tag.colorize(:yellow)}]: ".ljust(35) + image.full
|
103
|
+
newimg = image.retag!(opts['tag'])
|
104
|
+
$logger.info " To ".ljust(5) + "[#{newimg.tag.colorize(:yellow)}]: ".ljust(35) + newimg.full
|
94
105
|
end
|
95
106
|
|
96
107
|
end
|
@@ -109,6 +120,11 @@ class ReleaseCommand < Thor
|
|
109
120
|
required: false,
|
110
121
|
desc: "Env: #{ENV_PREFIX}_RELEASE_NAME. Name of the current release"
|
111
122
|
|
123
|
+
option :manifest, default: './manifest.md',
|
124
|
+
required: false,
|
125
|
+
type: :string,
|
126
|
+
desc: "Output file for Markdown manifest of the release"
|
127
|
+
|
112
128
|
def release(*_args)
|
113
129
|
opts = options.to_h.dup
|
114
130
|
$logger.level = :debug if opts['verbose']
|
@@ -128,6 +144,8 @@ class ReleaseCommand < Thor
|
|
128
144
|
|
129
145
|
$logger.info "*** Starting '#{tag_message.colorize(mode: :bold)}'...".colorize(:cyan)
|
130
146
|
|
147
|
+
markdown = "## Services\n\n"
|
148
|
+
|
131
149
|
services.each do |srv|
|
132
150
|
$logger.tagged(srv.name.colorize(:yellow), "#{srv.revision.colorize(mode: :bold)}@#{srv.branch}") do
|
133
151
|
$logger.info "#{'==>'.colorize(mode: :bold, color: :white)} Releasing service #{srv.name.colorize(mode: :bold)} from #{srv.repo.repo} at #{srv.branch.colorize(mode: :bold)}:".colorize(:green)
|
@@ -139,22 +157,28 @@ class ReleaseCommand < Thor
|
|
139
157
|
$logger.info "From ".ljust(5) + "[#{img.tag.colorize(:yellow)}]: ".ljust(35) + img.full
|
140
158
|
newimg = img.retag!(release)
|
141
159
|
$logger.info "To ".ljust(5) + "[#{newimg.tag.colorize(:yellow)}]: ".ljust(35) + newimg.full
|
160
|
+
|
161
|
+
markdown += "* **Name**: `#{srv.name}`<br>**Version**: #{img.tag}<br>**Image**: #{newimg.full}\n"
|
142
162
|
end
|
143
163
|
|
144
164
|
$logger.info ">>> Repo #{srv.repo.repo}"
|
145
165
|
|
146
166
|
$logger.shift do
|
147
167
|
$logger.info "From ".ljust(5) + "[#{srv.revision.colorize(:yellow)}]: ".ljust(35) + "#{srv.repo.repo}~#{srv.revision}@#{srv.branch}"
|
148
|
-
|
168
|
+
srv.repo.tag!(release, message: tag_message)
|
149
169
|
$logger.info "To ".ljust(5) + "[#{release.colorize(:yellow)}]: ".ljust(35) + "#{srv.repo.repo}~#{srv.revision}@#{release}"
|
150
170
|
end
|
151
|
-
|
152
|
-
srv.repo.tag!(release, message: tag_message)
|
171
|
+
|
153
172
|
end
|
154
173
|
end
|
155
174
|
end
|
156
175
|
end
|
157
176
|
|
177
|
+
File.write(opts['manifest'], markdown.strip)
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
158
182
|
$logger.info "*** Completed '#{tag_message.colorize(mode: :bold)}'".colorize(:cyan)
|
159
183
|
|
160
184
|
end
|
data/lib/retag/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samoilenko Yuri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|