vidar 1.1.4 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.dependabot/config.yml +0 -7
- data/.github/workflows/auto-approve.yml +3 -3
- data/.github/workflows/auto-merge.yml +19 -0
- data/Gemfile.lock +29 -25
- data/Rakefile +1 -1
- data/lib/vidar/cli.rb +3 -1
- data/lib/vidar/config.rb +1 -1
- data/lib/vidar/deploy_config.rb +1 -1
- data/lib/vidar/interpolation.rb +1 -1
- data/lib/vidar/log.rb +1 -1
- data/lib/vidar/slack_notification.rb +15 -7
- data/lib/vidar/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c3ae056c22e8845bf1ac3f1466ee039d734ced5310075fac57b8307e50cd8fd
|
4
|
+
data.tar.gz: 19d7a064152627fcef54561ff2097ca6302d5c95f5974271e019503c6b3bb945
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8aa88ec2442fb6082534094e9f0adeacab7c0580ffd3540ec84f12a1586431074c782a3b504233bdbb37efa7705b8eda2d0344e51c4d11a792d34db8377e0cda
|
7
|
+
data.tar.gz: 1168970bb83a07885619f13e3a5ec85d8731e1ae22207415d6791511dff63281814dfe670793cf09f5cd8f040996e5330d09f68e432f92b8a2194627180abdc6
|
data/.dependabot/config.yml
CHANGED
@@ -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
|
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
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
vidar (1.
|
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
|
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.
|
22
|
-
parser (2.7.
|
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.
|
30
|
+
regexp_parser (1.8.2)
|
30
31
|
rexml (3.2.4)
|
31
|
-
rspec (3.
|
32
|
-
rspec-core (~> 3.
|
33
|
-
rspec-expectations (~> 3.
|
34
|
-
rspec-mocks (~> 3.
|
35
|
-
rspec-core (3.
|
36
|
-
rspec-support (~> 3.
|
37
|
-
rspec-expectations (3.
|
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.
|
40
|
-
rspec-mocks (3.
|
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.
|
43
|
-
rspec-support (3.
|
44
|
-
rubocop (
|
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.
|
47
|
+
parser (>= 2.7.1.5)
|
47
48
|
rainbow (>= 2.2.2, < 4.0)
|
48
|
-
regexp_parser (>= 1.
|
49
|
+
regexp_parser (>= 1.8)
|
49
50
|
rexml
|
50
|
-
rubocop-ast (>=
|
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 (
|
54
|
-
parser (>= 2.7.
|
55
|
-
rubocop-performance (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
data/lib/vidar/cli.rb
CHANGED
@@ -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
|
-
|
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"
|
data/lib/vidar/config.rb
CHANGED
data/lib/vidar/deploy_config.rb
CHANGED
@@ -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)
|
data/lib/vidar/interpolation.rb
CHANGED
@@ -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
|
data/lib/vidar/log.rb
CHANGED
@@ -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 =
|
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 =
|
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
|
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":
|
59
|
-
"fallback":
|
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
|
86
|
+
build_url && "<#{build_url}|View the build.>"
|
79
87
|
end
|
80
88
|
end
|
81
89
|
end
|
data/lib/vidar/version.rb
CHANGED
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
|
+
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-
|
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.
|
228
|
+
rubygems_version: 3.1.4
|
228
229
|
signing_key:
|
229
230
|
specification_version: 4
|
230
231
|
summary: K8s deployment tools based on thor
|