vidar 1.1.4 → 1.3.2

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: b8cc826680e276230381b1cb5158840c827e48d56ebb3598861ebb3aaa6baa2c
4
- data.tar.gz: df2cbc9d2c82dddaf4219835905342f370e517a344c2bf2f46c8ebf5e27e18dd
3
+ metadata.gz: 5c3ae056c22e8845bf1ac3f1466ee039d734ced5310075fac57b8307e50cd8fd
4
+ data.tar.gz: 19d7a064152627fcef54561ff2097ca6302d5c95f5974271e019503c6b3bb945
5
5
  SHA512:
6
- metadata.gz: 9c7dc902f40eb18d022bf95c4874886ad828aab6a7c6ff06f2507aa8cb9b2dc3680a78d4d651d85d7af69ca29810c1afc562794dd395eb2044ca3ffad3652603
7
- data.tar.gz: b67b002b67712e37811d17dd2836e0a8b0bfe5de97f23c96c310cd8ae33cf57fd76b70ddc7e45e776503cb6f55576ac90fca6bfbee34468b35095c49d5ccb654
6
+ metadata.gz: 8aa88ec2442fb6082534094e9f0adeacab7c0580ffd3540ec84f12a1586431074c782a3b504233bdbb37efa7705b8eda2d0344e51c4d11a792d34db8377e0cda
7
+ data.tar.gz: 1168970bb83a07885619f13e3a5ec85d8731e1ae22207415d6791511dff63281814dfe670793cf09f5cd8f040996e5330d09f68e432f92b8a2194627180abdc6
@@ -9,10 +9,3 @@ update_configs:
9
9
  allowed_updates:
10
10
  - match:
11
11
  update_type: "all"
12
- automerged_updates:
13
- - match:
14
- dependency_type: "development"
15
- update_type: "all"
16
- - match:
17
- dependency_type: "production"
18
- update_type: "all"
@@ -1,7 +1,7 @@
1
- # automatically approve PRs submitted by Dependabot
1
+ # automatically approve PRs submitted by Dependabot or Renofidev
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
- name: Auto approve Dependabot PRs
4
+ name: Auto approve dependency upgrades PRs
5
5
 
6
6
  on:
7
7
  pull_request
@@ -11,6 +11,6 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: hmarr/auto-approve-action@v2.0.0
14
- if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
14
+ if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' || github.actor == 'renofidev'
15
15
  with:
16
16
  github-token: "${{ secrets.GITHUB_TOKEN }}"
@@ -0,0 +1,19 @@
1
+ name: automerge
2
+ on:
3
+ pull_request_review:
4
+ types:
5
+ - submitted
6
+ check_suite:
7
+ types:
8
+ - completed
9
+ status: {}
10
+ jobs:
11
+ automerge:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: automerge
15
+ uses: "pascalgn/automerge-action@v0.11.0"
16
+ env:
17
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
18
+ MERGE_METHOD: squash
19
+ MERGE_DELETE_BRANCH: true
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vidar (1.1.4)
4
+ vidar (1.3.2)
5
5
  colorize
6
6
  faraday
7
7
  thor (~> 1.0)
@@ -14,49 +14,53 @@ GEM
14
14
  coderay (1.1.3)
15
15
  colorize (0.8.1)
16
16
  diff-lcs (1.4.4)
17
- faraday (1.0.1)
17
+ faraday (1.1.0)
18
18
  multipart-post (>= 1.2, < 3)
19
+ ruby2_keywords
19
20
  method_source (1.0.0)
20
21
  multipart-post (2.1.1)
21
- parallel (1.19.2)
22
- parser (2.7.1.4)
22
+ parallel (1.20.0)
23
+ parser (2.7.2.0)
23
24
  ast (~> 2.4.1)
24
25
  pry (0.13.1)
25
26
  coderay (~> 1.1)
26
27
  method_source (~> 1.0)
27
28
  rainbow (3.0.0)
28
29
  rake (13.0.1)
29
- regexp_parser (1.7.1)
30
+ regexp_parser (1.8.2)
30
31
  rexml (3.2.4)
31
- rspec (3.9.0)
32
- rspec-core (~> 3.9.0)
33
- rspec-expectations (~> 3.9.0)
34
- rspec-mocks (~> 3.9.0)
35
- rspec-core (3.9.2)
36
- rspec-support (~> 3.9.3)
37
- rspec-expectations (3.9.2)
32
+ rspec (3.10.0)
33
+ rspec-core (~> 3.10.0)
34
+ rspec-expectations (~> 3.10.0)
35
+ rspec-mocks (~> 3.10.0)
36
+ rspec-core (3.10.0)
37
+ rspec-support (~> 3.10.0)
38
+ rspec-expectations (3.10.0)
38
39
  diff-lcs (>= 1.2.0, < 2.0)
39
- rspec-support (~> 3.9.0)
40
- rspec-mocks (3.9.1)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-mocks (3.10.0)
41
42
  diff-lcs (>= 1.2.0, < 2.0)
42
- rspec-support (~> 3.9.0)
43
- rspec-support (3.9.3)
44
- rubocop (0.88.0)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-support (3.10.0)
45
+ rubocop (1.2.0)
45
46
  parallel (~> 1.10)
46
- parser (>= 2.7.1.1)
47
+ parser (>= 2.7.1.5)
47
48
  rainbow (>= 2.2.2, < 4.0)
48
- regexp_parser (>= 1.7)
49
+ regexp_parser (>= 1.8)
49
50
  rexml
50
- rubocop-ast (>= 0.1.0, < 1.0)
51
+ rubocop-ast (>= 1.0.1)
51
52
  ruby-progressbar (~> 1.7)
52
53
  unicode-display_width (>= 1.4.0, < 2.0)
53
- rubocop-ast (0.2.0)
54
- parser (>= 2.7.0.1)
55
- rubocop-performance (1.7.1)
56
- rubocop (>= 0.82.0)
57
- rubocop-rspec (1.42.0)
54
+ rubocop-ast (1.1.1)
55
+ parser (>= 2.7.1.5)
56
+ rubocop-performance (1.8.1)
58
57
  rubocop (>= 0.87.0)
58
+ rubocop-ast (>= 0.4.0)
59
+ rubocop-rspec (2.0.0)
60
+ rubocop (~> 1.0)
61
+ rubocop-ast (>= 1.1.0)
59
62
  ruby-progressbar (1.10.1)
63
+ ruby2_keywords (0.0.2)
60
64
  thor (1.0.1)
61
65
  unicode-display_width (1.7.0)
62
66
 
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ require 'rubocop/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
  RuboCop::RakeTask.new
7
7
 
8
- task default: %i[rubocop:auto_correct spec]
8
+ task default: %i[spec rubocop:auto_correct]
@@ -65,9 +65,11 @@ module Vidar
65
65
 
66
66
  desc "deploy", "Perform k8s deployment with deploy hook"
67
67
  method_option :revision, required: false
68
+ method_option :kubectl_context, required: false
68
69
  def deploy
69
70
  revision = options[:revision] || Config.get!(:revision)
70
- Log.info "Current kubectl context: #{Config.get!(:kubectl_context)}"
71
+ kubectl_context = options[:kubectl_context] || Config.get!(:kubectl_context)
72
+ Log.info "Current kubectl context: #{kubectl_context}"
71
73
 
72
74
  Log.info "Looking for deploy hook..."
73
75
  template_name, error, status = Open3.capture3 "kubectl get cronjob deploy-hook-template -n #{Config.get!(:namespace)} -o name --ignore-not-found=true"
@@ -53,7 +53,7 @@ module Vidar
53
53
  end
54
54
 
55
55
  def build_url
56
- value = ENV[get(:build_env).to_s]
56
+ value = ENV[get(:build_env).to_s] || get(:build_url)
57
57
  value&.empty? ? nil : value
58
58
  end
59
59
 
@@ -10,7 +10,7 @@ module Vidar
10
10
 
11
11
  def initialize(options)
12
12
  @name = options.fetch(:name)
13
- @url = options.fetch(:url)
13
+ @url = options.fetch(:url, nil)
14
14
 
15
15
  @default_color = options.fetch(:default_color, DEFAULT_COLOR)
16
16
  @success_color = options.fetch(:success_color, SUCCESS_COLOR)
@@ -8,7 +8,7 @@ module Vidar
8
8
  fail ArgumentError, "getter must respond_to get." unless getter.respond_to?(:get)
9
9
 
10
10
  string.gsub(INTERPOLATION_PATTERN) do |match|
11
- getter.get($1) || match # rubocop:disable Style/PerlBackrefs
11
+ getter.get($1) || ENV[$1] || match # rubocop:disable Style/PerlBackrefs
12
12
  end
13
13
  end
14
14
  end
@@ -2,7 +2,7 @@ module Vidar
2
2
  class Log
3
3
  class << self
4
4
  def line
5
- puts "|" + "-" * 142 + "|"
5
+ puts "|#{'-' * 142}|"
6
6
  end
7
7
 
8
8
  def info(text, fill_with = "#")
@@ -5,7 +5,6 @@ module Vidar
5
5
  @revision = revision
6
6
  @revision_name = revision_name
7
7
  @build_url = build_url
8
- @build_hostname = ::URI.parse(build_url || '').hostname
9
8
  @deploy_name = deploy_config.name
10
9
  @deploy_url = deploy_config.url
11
10
  @default_color = deploy_config.default_color
@@ -20,12 +19,19 @@ module Vidar
20
19
  end
21
20
 
22
21
  def failure
23
- message = "Failed deploy of #{github_link} to #{deploy_link} :fire: <!channel> #{build_link}"
22
+ message = [
23
+ "Failed deploy of #{github_link} to #{deploy_link}.",
24
+ ":fire: <!channel>",
25
+ build_link
26
+ ]
24
27
  perform_with data(message: message, color: failure_color)
25
28
  end
26
29
 
27
30
  def success
28
- message = "Successful deploy of #{github_link} to #{deploy_link}. #{build_link}"
31
+ message = [
32
+ "Successful deploy of #{github_link} to #{deploy_link}.",
33
+ build_link
34
+ ]
29
35
  perform_with data(message: message, color: success_color)
30
36
  end
31
37
 
@@ -46,17 +52,18 @@ module Vidar
46
52
  attr_reader :github, :revision, :revision_name,
47
53
  :deploy_name, :deploy_url, :webhook_url,
48
54
  :default_color, :success_color, :failure_color,
49
- :connection, :build_url, :build_hostname
55
+ :connection, :build_url
50
56
 
51
57
  def data(message:, color:)
58
+ text = [message].flatten.compact.join("\n")
52
59
  {
53
60
  "attachments": [
54
61
  {
55
62
  "title": github,
56
63
  "title_link": github_url,
57
64
  "color": color,
58
- "text": message,
59
- "fallback": message
65
+ "text": text,
66
+ "fallback": text,
60
67
  }
61
68
  ]
62
69
  }
@@ -71,11 +78,12 @@ module Vidar
71
78
  end
72
79
 
73
80
  def deploy_link
81
+ return deploy_name unless deploy_url
74
82
  "<#{deploy_url}|#{deploy_name}>"
75
83
  end
76
84
 
77
85
  def build_link
78
- build_url && "<#{build_url}|View the build on #{build_hostname}>"
86
+ build_url && "<#{build_url}|View the build.>"
79
87
  end
80
88
  end
81
89
  end
@@ -1,3 +1,3 @@
1
1
  module Vidar
2
- VERSION = '1.1.4'.freeze
2
+ VERSION = '1.3.2'.freeze
3
3
  end
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.1.4
4
+ version: 1.3.2
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: 2020-07-20 00:00:00.000000000 Z
12
+ date: 2020-11-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colorize
@@ -180,6 +180,7 @@ files:
180
180
  - ".github/ISSUE_TEMPLATE/story.md"
181
181
  - ".github/PULL_REQUEST_TEMPLATE.md"
182
182
  - ".github/workflows/auto-approve.yml"
183
+ - ".github/workflows/auto-merge.yml"
183
184
  - ".gitignore"
184
185
  - ".rspec"
185
186
  - ".travis.yml"
@@ -224,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
224
225
  - !ruby/object:Gem::Version
225
226
  version: '0'
226
227
  requirements: []
227
- rubygems_version: 3.1.2
228
+ rubygems_version: 3.1.4
228
229
  signing_key:
229
230
  specification_version: 4
230
231
  summary: K8s deployment tools based on thor