vidar 1.4.1 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3d537f85d8832eee399a795a023d6d1ec8d7c755742028bfebdc284faf1a73a
4
- data.tar.gz: 9b9402f61125844939c73fdf1106a8e3b7b06d98a2445627bcc73ce3bed419bc
3
+ metadata.gz: 67ea48d5694ee975aac8c0122b35891a07663da7f6ed897b5da4af401fec0b25
4
+ data.tar.gz: 7d3e3876268d1a1b455dbf3e126cb41b5ecb54beaa2ae72adb8aa8e803d4e713
5
5
  SHA512:
6
- metadata.gz: f52e9983f88d1158cf00e3f1343f1fe8b21947766dd81ad59d0853c5fc1393f2d8f849d0de66239a431ef58a799b323269706cb8f9af3887e630cd9fef21d4e5
7
- data.tar.gz: ddc33975a9aebebc95b22096fda74a683faf3225517d27c1739a024d7eaa6f81fa77afceeba3b28c64b55aef285c38fda188c9b31bea256489ddaa1394405459
6
+ metadata.gz: df9143590421ea15f86ea20e783178b018f9c8a7c6abffc5bfa7b91223c270ed519bbd29caf0be154776d03eb2de6b9caa6c409d55bcf803b07138de4e139133
7
+ data.tar.gz: 8754dae3249c781998ed949c3d13243938aa2845aba2c117aceb9f951b7af76867c593ea7e09d8558cf9536a45921bce7355204bd8d1aea93c18099a1dfade72
data/.bundler-version CHANGED
@@ -1 +1 @@
1
- 2.2.27
1
+ 2.3.11
@@ -2,15 +2,13 @@
2
2
  # this will allow Dependabot to automatically merge dependency update PRs where CI passes
3
3
  # from: https://github.com/hmarr/auto-approve-action
4
4
  name: Auto approve dependency upgrades PRs
5
-
6
- on:
7
- pull_request
5
+ on: pull_request_target
8
6
 
9
7
  jobs:
10
8
  auto-approve:
11
9
  runs-on: ubuntu-latest
12
10
  steps:
13
- - uses: hmarr/auto-approve-action@v2.0.0
11
+ - uses: hmarr/auto-approve-action@v2
14
12
  if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' || github.actor == 'renofidev'
15
13
  with:
16
14
  github-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: ['2.7', '3.0']
14
+ ruby-version: ['3.0', 3.1]
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v2
@@ -19,7 +19,7 @@ jobs:
19
19
  # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
20
20
  # change this to (see https://github.com/ruby/setup-ruby#versioning):
21
21
  # uses: ruby/setup-ruby@v1
22
- uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
22
+ uses: ruby/setup-ruby@bd94d6a504586da892a5753afdd1480096ed30df
23
23
  with:
24
24
  ruby-version: ${{ matrix.ruby-version }}
25
25
  bundler-cache: true # runs 'bundle install' and caches installed gems automatically
data/CHANGELOG.md CHANGED
@@ -1,6 +1,5 @@
1
1
  # CHANGELOG
2
2
 
3
- ## 1.4.0 - 2020-12-14
3
+ ## 1.5.0 - 2022-04-20
4
4
 
5
- - make `default_branch` to be auto-detected
6
- from `main` and `master`, so it works with [the new github convention]) https://github.blog/changelog/2020-10-01-the-default-branch-for-newly-created-repositories-is-now-main)
5
+ - Drop ruby 2.7 support and test against ruby 3.1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vidar (1.4.1)
4
+ vidar (1.5.0)
5
5
  colorize
6
6
  faraday
7
7
  thor (~> 1.0)
@@ -17,71 +17,55 @@ GEM
17
17
  colorize (0.8.1)
18
18
  crack (0.4.5)
19
19
  rexml
20
- diff-lcs (1.4.4)
21
- faraday (1.8.0)
22
- faraday-em_http (~> 1.0)
23
- faraday-em_synchrony (~> 1.0)
24
- faraday-excon (~> 1.1)
25
- faraday-httpclient (~> 1.0.1)
26
- faraday-net_http (~> 1.0)
27
- faraday-net_http_persistent (~> 1.1)
28
- faraday-patron (~> 1.0)
29
- faraday-rack (~> 1.0)
30
- multipart-post (>= 1.2, < 3)
20
+ diff-lcs (1.5.0)
21
+ faraday (2.2.0)
22
+ faraday-net_http (~> 2.0)
31
23
  ruby2_keywords (>= 0.0.4)
32
- faraday-em_http (1.0.0)
33
- faraday-em_synchrony (1.0.0)
34
- faraday-excon (1.1.0)
35
- faraday-httpclient (1.0.1)
36
- faraday-net_http (1.0.1)
37
- faraday-net_http_persistent (1.2.0)
38
- faraday-patron (1.0.0)
39
- faraday-rack (1.0.0)
24
+ faraday-net_http (2.0.2)
40
25
  hashdiff (1.0.1)
41
26
  method_source (1.0.0)
42
- multipart-post (2.1.1)
43
- parallel (1.21.0)
44
- parser (3.0.2.0)
27
+ parallel (1.22.1)
28
+ parser (3.1.2.0)
45
29
  ast (~> 2.4.1)
46
30
  pry (0.14.1)
47
31
  coderay (~> 1.1)
48
32
  method_source (~> 1.0)
49
- public_suffix (4.0.6)
50
- rainbow (3.0.0)
33
+ public_suffix (4.0.7)
34
+ rainbow (3.1.1)
51
35
  rake (13.0.6)
52
- regexp_parser (2.1.1)
36
+ regexp_parser (2.3.0)
53
37
  rexml (3.2.5)
54
- rspec (3.10.0)
55
- rspec-core (~> 3.10.0)
56
- rspec-expectations (~> 3.10.0)
57
- rspec-mocks (~> 3.10.0)
58
- rspec-core (3.10.1)
59
- rspec-support (~> 3.10.0)
60
- rspec-expectations (3.10.1)
38
+ rspec (3.11.0)
39
+ rspec-core (~> 3.11.0)
40
+ rspec-expectations (~> 3.11.0)
41
+ rspec-mocks (~> 3.11.0)
42
+ rspec-core (3.11.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-expectations (3.11.0)
61
45
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.10.0)
63
- rspec-mocks (3.10.2)
46
+ rspec-support (~> 3.11.0)
47
+ rspec-mocks (3.11.1)
64
48
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.10.0)
66
- rspec-support (3.10.2)
67
- rubocop (1.22.0)
49
+ rspec-support (~> 3.11.0)
50
+ rspec-support (3.11.0)
51
+ rubocop (1.27.0)
68
52
  parallel (~> 1.10)
69
- parser (>= 3.0.0.0)
53
+ parser (>= 3.1.0.0)
70
54
  rainbow (>= 2.2.2, < 4.0)
71
55
  regexp_parser (>= 1.8, < 3.0)
72
56
  rexml
73
- rubocop-ast (>= 1.12.0, < 2.0)
57
+ rubocop-ast (>= 1.16.0, < 2.0)
74
58
  ruby-progressbar (~> 1.7)
75
59
  unicode-display_width (>= 1.4.0, < 3.0)
76
- rubocop-ast (1.12.0)
77
- parser (>= 3.0.1.1)
60
+ rubocop-ast (1.17.0)
61
+ parser (>= 3.1.1.0)
78
62
  rubocop-rake (0.6.0)
79
63
  rubocop (~> 1.0)
80
- rubocop-rspec (2.5.0)
64
+ rubocop-rspec (2.10.0)
81
65
  rubocop (~> 1.19)
82
66
  ruby-progressbar (1.11.0)
83
67
  ruby2_keywords (0.0.5)
84
- thor (1.1.0)
68
+ thor (1.2.1)
85
69
  unicode-display_width (2.1.0)
86
70
  webmock (3.14.0)
87
71
  addressable (>= 2.8.0)
@@ -89,7 +73,11 @@ GEM
89
73
  hashdiff (>= 0.4.0, < 2.0.0)
90
74
 
91
75
  PLATFORMS
76
+ aarch64-linux-musl
77
+ x86_64-darwin-18
78
+ x86_64-darwin-19
92
79
  x86_64-darwin-20
80
+ x86_64-darwin-21
93
81
  x86_64-linux
94
82
 
95
83
  DEPENDENCIES
@@ -105,4 +93,4 @@ DEPENDENCIES
105
93
  webmock
106
94
 
107
95
  BUNDLED WITH
108
- 2.2.28
96
+ 2.3.11
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/vidar.svg)](https://rubygems.org/gems/vidar)
2
- [![Build Status](https://travis-ci.org/RenoFi/vidar.svg?branch=master)](https://travis-ci.org/RenoFi/vidar)
2
+ [![Build Status](https://github.com/RenoFi/vidar/actions/workflows/ci.yml/badge.svg)](https://github.com/RenoFi/vidar/actions/workflows/ci.yml?query=branch%3Amain)
3
3
 
4
4
  # vidar
5
5
 
data/lib/vidar/cli.rb CHANGED
@@ -84,6 +84,7 @@ module Vidar
84
84
  Run.kubectl "create job deploy-hook --from=#{template_name}"
85
85
 
86
86
  deploy_status = Vidar::DeployStatus.new(namespace: Config.get!(:namespace), filter: "deploy-hook")
87
+ deploy_status.wait_until_up
87
88
  deploy_status.wait_until_completed
88
89
 
89
90
  unless deploy_status.success?
@@ -158,7 +159,7 @@ module Vidar
158
159
  else
159
160
  Log.info "Available containers:"
160
161
  containers.each(&:print)
161
- container = containers.detect { c.name == 'console' } || containers.last
162
+ container = containers.detect { |c| c.name == 'console' } || containers.last
162
163
 
163
164
  Log.info "Running #{options[:command]} in #{container.pod_name}"
164
165
  Run.kubectl("exec -it #{container.pod_name} -- #{options[:command]}")
@@ -12,6 +12,20 @@ module Vidar
12
12
  @max_tries = max_tries
13
13
  end
14
14
 
15
+ def wait_until_up
16
+ tries = 0
17
+
18
+ sleep(INITIAL_SLEEP)
19
+
20
+ until pod_set.any?
21
+ tries += 1
22
+ sleep(SLEEP)
23
+ if tries > max_tries
24
+ break
25
+ end
26
+ end
27
+ end
28
+
15
29
  def wait_until_completed
16
30
  tries = 0
17
31
 
@@ -28,6 +42,7 @@ module Vidar
28
42
 
29
43
  def success?
30
44
  return false unless last_pod_set
45
+
31
46
  last_pod_set.success?
32
47
  end
33
48
 
@@ -36,7 +51,7 @@ module Vidar
36
51
  end
37
52
 
38
53
  def pod_set
39
- @pod_set = K8s::PodSet.new(namespace: namespace, filter: filter)
54
+ @pod_set = K8s::PodSet.new(namespace:, filter:)
40
55
  end
41
56
  end
42
57
  end
@@ -6,6 +6,10 @@ module Vidar
6
6
  @filter = filter
7
7
  end
8
8
 
9
+ def any?
10
+ containers.any?
11
+ end
12
+
9
13
  def deployed?
10
14
  if items.empty?
11
15
  Log.error "Could not fetch pod list"
@@ -24,7 +24,7 @@ module Vidar
24
24
  ":fire: <!channel>",
25
25
  build_link
26
26
  ]
27
- perform_with data(message: message, color: failure_color)
27
+ perform_with data(message:, color: failure_color)
28
28
  end
29
29
 
30
30
  def success
@@ -32,11 +32,11 @@ module Vidar
32
32
  "Successful deploy of #{github_link} to #{deploy_link}.",
33
33
  build_link
34
34
  ]
35
- perform_with data(message: message, color: success_color)
35
+ perform_with data(message:, color: success_color)
36
36
  end
37
37
 
38
38
  def deliver(message:, color: default_color)
39
- perform_with data(message: message, color: color)
39
+ perform_with data(message:, color:)
40
40
  end
41
41
 
42
42
  def perform_with(data)
@@ -61,8 +61,8 @@ module Vidar
61
61
  {
62
62
  title: github,
63
63
  title_link: github_url,
64
- color: color,
65
- text: text,
64
+ color:,
65
+ text:,
66
66
  fallback: text,
67
67
  }
68
68
  ]
@@ -79,6 +79,7 @@ module Vidar
79
79
 
80
80
  def deploy_link
81
81
  return deploy_name unless deploy_url
82
+
82
83
  "<#{deploy_url}|#{deploy_name}>"
83
84
  end
84
85
 
data/lib/vidar/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vidar
2
- VERSION = '1.4.1'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
data/vidar.gemspec CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.metadata['homepage_uri'] = 'https://github.com/RenoFi/vidar'
16
16
  spec.metadata['source_code_uri'] = 'https://github.com/RenoFi/vidar'
17
17
  spec.metadata['changelog_uri'] = 'https://github.com/RenoFi/vidar/blob/master/CHANGELOG.md'
18
+ spec.metadata['rubygems_mfa_required'] = 'true'
18
19
 
19
20
  spec.files = Dir.chdir(__dir__) do
20
21
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(bin/|spec/|\.rub)}) }
@@ -23,7 +24,7 @@ Gem::Specification.new do |spec|
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
25
  spec.require_paths = ['lib']
25
26
 
26
- spec.required_ruby_version = '>= 2.6'
27
+ spec.required_ruby_version = '>= 3.0'
27
28
 
28
29
  spec.add_dependency 'colorize'
29
30
  spec.add_dependency 'faraday'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vidar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krzysztof Knapik
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2021-09-30 00:00:00.000000000 Z
12
+ date: 2022-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -227,6 +227,7 @@ metadata:
227
227
  homepage_uri: https://github.com/RenoFi/vidar
228
228
  source_code_uri: https://github.com/RenoFi/vidar
229
229
  changelog_uri: https://github.com/RenoFi/vidar/blob/master/CHANGELOG.md
230
+ rubygems_mfa_required: 'true'
230
231
  post_install_message:
231
232
  rdoc_options: []
232
233
  require_paths:
@@ -235,14 +236,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
236
  requirements:
236
237
  - - ">="
237
238
  - !ruby/object:Gem::Version
238
- version: '2.6'
239
+ version: '3.0'
239
240
  required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  requirements:
241
242
  - - ">="
242
243
  - !ruby/object:Gem::Version
243
244
  version: '0'
244
245
  requirements: []
245
- rubygems_version: 3.2.23
246
+ rubygems_version: 3.3.11
246
247
  signing_key:
247
248
  specification_version: 4
248
249
  summary: K8s deployment tools based on thor