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: e57ef2ce78d3fea8e0549d6abbf7c5d3d36e924a0c9c046e290edbcd64467fa1
4
- data.tar.gz: ea822c830cc12c47fd778cdfd1ece7046c41f56241f97b8c3e3354b872ce2885
3
+ metadata.gz: d8df2dc3a1002c350f7b526131e7deb36deb429b80af3edf6c1c76b383e88066
4
+ data.tar.gz: ed08a82c9bb16704a61dfe9b484783b44a63f6ec73b7692fb4ed74e2af6c39f4
5
5
  SHA512:
6
- metadata.gz: d7211e41a2d7a13025e24577fa35aab821269a80e542f2ac8691f1a3953af91ccde6d800fad1f8da097e9650ef914929a4d837c7ef51974a96972a00040b60e6
7
- data.tar.gz: ce2b6c48e72ae08b9206aa070211b0b6bbb3991380f5ad6c09068007dd406ff737d957f39b73483864bb11f34db8ec8bbd5a42736b050d0a2871b37f6bb65fa3
6
+ metadata.gz: 0fe5464f0cca9ae34adae28892557f9c70359a452120f469e3e5a953bd83bb5a669a227738f743ecf616cdde9c50527bc2a4a998574d80767efa0e7a81645b56
7
+ data.tar.gz: 434628d3ed46a5d74a95144695ec63f7688fdefe2d13bcb30a684778ee811465b443a8e41d57219a784acf5b1fd1841d1d017cfa93e2a4abf6fb1f7fdde49b1a
@@ -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: ../src_mobile_app
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, tag = t.split(':')
48
- full_tag = [full_version, push_tag || tag].compact.join('-')
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
@@ -1,5 +1,5 @@
1
1
  module BuildLabels
2
2
  class Builder
3
- VERSION = '0.0.54'
3
+ VERSION = '0.0.55'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-labels
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.54
4
+ version: 0.0.55
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B