retag 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/retag +21 -4
- data/lib/retag/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e71af667189dceff7c2606302321bedfa7defebc54e3c77d73a3d4d2a1d1cfe8
|
4
|
+
data.tar.gz: cfdbf324852f22a679609651ed49b1bb7519247d778ace647f056673620aed56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b324b0efdaa8e56771c8fc2ab5867d67c4a641eab9531a614d1d4d510fb07d4ec9d3e8248a661970f498f8d5291def7ea0c641d478879ff7fdf48d5c632ec47a
|
7
|
+
data.tar.gz: 51967abd9fec922eb7de05eaec2a4cbf244d318498c82d8347d15a2df86e51b66c02531f55eb2aa8b61aa5810af5e00e0bdaf907e70735bc184adebccbc14fff
|
data/bin/retag
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'yaml'
|
4
|
+
require 'erb'
|
4
5
|
require 'thor'
|
5
6
|
require 'colorize'
|
6
7
|
require 'retag'
|
@@ -42,6 +43,22 @@ class RepoCommand < Thor
|
|
42
43
|
|
43
44
|
puts Gitlab.client.create_tag(project, tag, options['ref'], options['message']).inspect
|
44
45
|
end
|
46
|
+
|
47
|
+
desc "release <project> <tag>", "Create tag in Gitlab project"
|
48
|
+
long_desc <<-LONGDESC
|
49
|
+
LONGDESC
|
50
|
+
|
51
|
+
option :ref, default: ENV.fetch("#{ENV_PREFIX}_RELEASE_REF", 'master'),
|
52
|
+
required: true,
|
53
|
+
type: :string,
|
54
|
+
desc: "Gtilab refspec from which create tag"
|
55
|
+
|
56
|
+
option :description, default: nil,
|
57
|
+
type: :string,
|
58
|
+
desc: "description Markdown"
|
59
|
+
def release(project, tag)
|
60
|
+
Gitlab.client.create_project_release(project, name: tag, tag_name: tag, description: description, ref: options['ref'])
|
61
|
+
end
|
45
62
|
end
|
46
63
|
|
47
64
|
class DockerCommand < Thor
|
@@ -96,14 +113,14 @@ class ReleaseCommand < Thor
|
|
96
113
|
opts = options.to_h.dup
|
97
114
|
$logger.level = :debug if opts['verbose']
|
98
115
|
|
99
|
-
config = YAML.
|
116
|
+
config = YAML.load(ERB.new(File.read(File.expand_path(opts['config']))).result)
|
100
117
|
config['release'] = opts['name'] || config['release']
|
101
118
|
|
102
119
|
release = config['release'].to_s
|
103
|
-
suffix = config['suffix']
|
104
|
-
branch = config['branch']
|
120
|
+
suffix = config['default-suffix']
|
121
|
+
branch = config['default-branch']
|
105
122
|
|
106
|
-
services = config['services'].map do|(name, cfg)|
|
123
|
+
services = config['services'].map do|(name, cfg)|
|
107
124
|
Retag::Service.new(name, cfg, release, suffix: cfg.fetch('suffix', suffix), branch: cfg.fetch('branch', branch)) unless name.start_with?('.')
|
108
125
|
end.compact
|
109
126
|
|
data/lib/retag/version.rb
CHANGED