build-labels 0.0.54 → 0.0.55
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8df2dc3a1002c350f7b526131e7deb36deb429b80af3edf6c1c76b383e88066
|
4
|
+
data.tar.gz: ed08a82c9bb16704a61dfe9b484783b44a63f6ec73b7692fb4ed74e2af6c39f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe5464f0cca9ae34adae28892557f9c70359a452120f469e3e5a953bd83bb5a669a227738f743ecf616cdde9c50527bc2a4a998574d80767efa0e7a81645b56
|
7
|
+
data.tar.gz: 434628d3ed46a5d74a95144695ec63f7688fdefe2d13bcb30a684778ee811465b443a8e41d57219a784acf5b1fd1841d1d017cfa93e2a4abf6fb1f7fdde49b1a
|
data/examples/common-compose.yml
CHANGED
@@ -7,7 +7,7 @@ x-common-build: &common-build
|
|
7
7
|
- CI_COMMIT_TIMESTAMP=${CI_COMMIT_TIMESTAMP}
|
8
8
|
- CI_PROJECT_PATH_SLUG=${CI_PROJECT_PATH_SLUG}
|
9
9
|
- CI_COMMIT_BRANCH=${CI_COMMIT_BRANCH}
|
10
|
-
context:
|
10
|
+
context: ./src_app
|
11
11
|
dockerfile: ../docker/flutter/Dockerfile
|
12
12
|
|
13
13
|
services:
|
@@ -51,6 +51,7 @@ module BuildLabels
|
|
51
51
|
o.on('-h', '--help') { puts o; exit }
|
52
52
|
rest = o.parse! args, into: params
|
53
53
|
|
54
|
+
params.transform_keys!{_1.to_s.gsub('-','_').to_sym}
|
54
55
|
|
55
56
|
compose_text = File.read(params[:compose]) if params[:compose]
|
56
57
|
compose_text ||= STDIN.read unless $stdin.tty?
|
@@ -1,6 +1,9 @@
|
|
1
1
|
require_relative 'command_line'
|
2
2
|
|
3
3
|
BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
4
|
+
def options(parser)
|
5
|
+
parser.on('', '--full-version', 'Push full version tag')
|
6
|
+
end
|
4
7
|
|
5
8
|
def run(builder, params, compose)
|
6
9
|
raise 'Compose file not defined' unless compose
|
@@ -30,6 +33,11 @@ BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
|
30
33
|
end
|
31
34
|
|
32
35
|
build_id = ENV['GITHUB_RUN_NUMBER'] || ENV['CI_PIPELINE_IID']
|
36
|
+
unless build_id
|
37
|
+
puts "Build ID not found. Please set GITHUB_RUN_NUMBER or CI_PIPELINE_IID environment variable"
|
38
|
+
exit 1
|
39
|
+
end
|
40
|
+
|
33
41
|
full_version = "#{current_version}.#{build_id}"
|
34
42
|
builder.oc.version = full_version
|
35
43
|
|
@@ -40,12 +48,12 @@ BuildLabels::CommandLine::COMMANDS[:set_version] = Class.new do
|
|
40
48
|
[image, full_tag].compact.join ':'
|
41
49
|
end
|
42
50
|
|
43
|
-
if ENV['CI_COMMIT_MESSAGE'].to_s =~ /#push/mi
|
51
|
+
if ENV['CI_COMMIT_MESSAGE'].to_s =~ /#push/mi || params[:full_version]
|
44
52
|
push_tag = ENV['CI_COMMIT_MESSAGE'].to_s[/#push:(\S+)/mi, 1]
|
45
53
|
|
46
54
|
svc['build']['tags'] += svc['build']['tags'].map do |t|
|
47
|
-
image,
|
48
|
-
full_tag = [full_version, push_tag
|
55
|
+
image, _tag = t.split(':')
|
56
|
+
full_tag = [full_version, push_tag].compact.join('-')
|
49
57
|
|
50
58
|
[image, full_tag].compact.join ':'
|
51
59
|
end
|
@@ -1,6 +1,10 @@
|
|
1
1
|
require_relative 'command_line'
|
2
2
|
|
3
3
|
BuildLabels::CommandLine::COMMANDS[:to_compose] = Class.new do
|
4
|
+
def options(parser)
|
5
|
+
parser.on('', '--except FILTER', 'filter services ')
|
6
|
+
end
|
7
|
+
|
4
8
|
def run(builder, params, compose)
|
5
9
|
raise 'Compose file not defined' unless compose
|
6
10
|
|
data/lib/version.rb
CHANGED