retag 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/retag +21 -4
  3. data/lib/retag/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab9f253e8ff9f3a7bfd637ddaa844cff811d3c75f79fde036bdacd8eb1f58f91
4
- data.tar.gz: d36f32cb6b21896c28901f18420ef1ccf4207e4cf2683c42407bebd52662f761
3
+ metadata.gz: e71af667189dceff7c2606302321bedfa7defebc54e3c77d73a3d4d2a1d1cfe8
4
+ data.tar.gz: cfdbf324852f22a679609651ed49b1bb7519247d778ace647f056673620aed56
5
5
  SHA512:
6
- metadata.gz: 484c2c98bf6d72545501c1b4b43e139579ee37af5b8f0e1c7e5bf1c28998a8ba4c039fb4a2e7042edbdbf56304420d28b186104863599834c1a6db3ab8c78249
7
- data.tar.gz: 390312a1b807c7790a80e4bb5e9f68c6644455b267dcbdd965d260af58106030b9b11cbc1477f21ac78f6a230660e09aef1d32313e94a5301f37b32bef60cd5d
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.load_file(File.expand_path(opts['config']))
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Retag
4
4
 
5
- VERSION = '0.1.6'
5
+ VERSION = '0.1.7'
6
6
 
7
7
  end
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retag
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samoilenko Yuri