build-labels 0.0.50 → 0.0.51
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/lib/build-labels/command_set_version.rb +14 -4
- data/lib/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: 1dd0ab3713ab953a545d5a6456db074b242748188266c59d36e13f8bb9321b98
|
4
|
+
data.tar.gz: 1aa8398326b99a8c32c625844a27687e98f62c8c212fc5d55af76d60afed6899
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aeb2d54fce775def42049f7187d576450532e6330a57b3873f817cc9ed557ad61b280ab64d0b0db449698ee2a0effe22076c096f86503e883076ef6f442eedd
|
7
|
+
data.tar.gz: f93a653b6e36b290eef8af7365a3f0f5fc0e9d5f3c13b12127f7d960f43b858e3a729e240cdf266a49bf94f8b3e4a482d3cff7f2ee44732f5cc2ad485c3864a8
|
@@ -2,7 +2,7 @@ require_relative 'command_line'
|
|
2
2
|
|
3
3
|
BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
4
4
|
|
5
|
-
def run(
|
5
|
+
def run(builder, params, compose)
|
6
6
|
raise 'Compose file not defined' unless compose
|
7
7
|
|
8
8
|
compose_dir = params[:compose] ? File.dirname(params[:compose]) : '.'
|
@@ -17,7 +17,19 @@ BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
|
17
17
|
version_file = File.join version_file, '.version'
|
18
18
|
version_file = File.expand_path version_file, compose_dir
|
19
19
|
|
20
|
-
|
20
|
+
unless File.exist?(version_file)
|
21
|
+
puts "Version file not found: #{version_file}"
|
22
|
+
exit 1
|
23
|
+
end
|
24
|
+
|
25
|
+
current_version = File.read(version_file).strip
|
26
|
+
unless current_version =~ /\d+(\.\d+)*/
|
27
|
+
puts "Invalid version file: #{version_file}. Expected version in format: numbers separated by dots (e.g. 1.2.3)"
|
28
|
+
exit 1
|
29
|
+
end
|
30
|
+
|
31
|
+
full_version = "#{current_version}.#{ENV['CI_PIPELINE_IID']}"
|
32
|
+
builder.oc.version = full_version
|
21
33
|
|
22
34
|
svc['build']['tags'] = svc['build']['tags'].map do |t|
|
23
35
|
image, tag = t.split(':')
|
@@ -27,8 +39,6 @@ BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
|
27
39
|
end
|
28
40
|
|
29
41
|
if ENV['CI_COMMIT_MESSAGE'].to_s =~ /#push/mi
|
30
|
-
full_version = "#{current_version.to_s.empty? ? '0.0' : current_version}.#{ENV['CI_PIPELINE_IID']}"
|
31
|
-
|
32
42
|
push_tag = ENV['CI_COMMIT_MESSAGE'].to_s[/#push:(\S+)/mi, 1]
|
33
43
|
|
34
44
|
svc['build']['tags'] += svc['build']['tags'].map do |t|
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-labels
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.51
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artyom B
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|