talentio-notifier 0.3.0 → 0.3.5
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 +4 -4
- data/Dockerfile +2 -2
- data/Gemfile.lock +3 -2
- data/Makefile +1 -1
- data/README.md +8 -0
- data/bin/talentio-notifier +0 -0
- data/lib/talentio/notifier/slack.rb +2 -21
- data/lib/talentio/notifier/slack/interview.rb +2 -2
- data/lib/talentio/notifier/slack/selection_result.rb +4 -4
- data/lib/talentio/notifier/version.rb +1 -1
- data/manifests/cron.yml +4 -3
- data/talentio-notifier.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ab95645c024ef8541200bbffb70ba196377c46a1337b4243410da86a5b538c03
|
|
4
|
+
data.tar.gz: 0b4892fefdd35d45ee2caeb0bc4a06b77879c598c566803f4756004abc0ca1de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5447045371a31ffbf115ce1e41cf50e41bd70de3fc3e7e4a72dfda1909f77d7ce4bfc5b90a5c6d28ff796cadbebe81896e51a5dd62d8ca9e21933040cc5d7b04
|
|
7
|
+
data.tar.gz: d7e1e35a8486a6ebd6b5b64d2354d569ebd5d804363cc1f7bbaeff3a29b7e59f2a9d3f5a1bfa7f8ed61813003a54815f329eb865e2cce096364c44df55ba042d
|
data/Dockerfile
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
FROM ruby:
|
|
1
|
+
FROM ruby:2.6.5
|
|
2
2
|
WORKDIR /talentio-notifier
|
|
3
3
|
ENV LANG C.UTF-8
|
|
4
4
|
RUN apt update -qqy && apt install -qqy python git python-yaml
|
|
5
5
|
RUN git clone https://github.com/emasaka/jpholidayp.git
|
|
6
|
-
RUN gem install talentio-notifier -v "0.3.
|
|
6
|
+
RUN gem install talentio-notifier -v "0.3.5"
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
talentio-notifier (0.
|
|
4
|
+
talentio-notifier (0.3.5)
|
|
5
|
+
activesupport
|
|
5
6
|
faraday
|
|
6
7
|
holiday_jp
|
|
7
8
|
slack-api
|
|
@@ -30,7 +31,7 @@ GEM
|
|
|
30
31
|
gli (2.19.2)
|
|
31
32
|
hashie (4.1.0)
|
|
32
33
|
holiday_jp (0.7.1)
|
|
33
|
-
i18n (1.8.
|
|
34
|
+
i18n (1.8.5)
|
|
34
35
|
concurrent-ruby (~> 1.0)
|
|
35
36
|
minitest (5.14.1)
|
|
36
37
|
multi_json (1.15.0)
|
data/Makefile
CHANGED
data/README.md
CHANGED
|
@@ -25,6 +25,14 @@ $ talentio-notifier remind-interview
|
|
|
25
25
|
|
|
26
26
|
開発者の所属する企業ではk8sを利用して運用しています。manifestsについても `manifests` 配下のものを利用可能です。
|
|
27
27
|
|
|
28
|
+
### apply
|
|
29
|
+
```bash
|
|
30
|
+
$ kubectl create secret generic talentio-notifier-secret \
|
|
31
|
+
--from-literal=talentio-apikey=$TALENTIO_APIKEY \
|
|
32
|
+
--from-literal=slack-apikey=$SLACK_APIKEY
|
|
33
|
+
$ kubectl apply -f manifests/cron.yml
|
|
34
|
+
```
|
|
35
|
+
|
|
28
36
|
## 環境変数
|
|
29
37
|
|
|
30
38
|
APIキーなどは環境変数で指定してください。
|
data/bin/talentio-notifier
CHANGED
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
require 'time'
|
|
2
2
|
require 'json'
|
|
3
3
|
require 'pp'
|
|
4
|
-
require 'slack'
|
|
4
|
+
require 'slack-ruby-client'
|
|
5
5
|
require 'holiday_jp'
|
|
6
|
-
require '
|
|
6
|
+
require 'active_support/core_ext/module'
|
|
7
7
|
module Talentio
|
|
8
8
|
module Notifier
|
|
9
9
|
class Slack
|
|
@@ -47,25 +47,6 @@ module Talentio
|
|
|
47
47
|
conf.token = ENV['SLACK_APIKEY']
|
|
48
48
|
end
|
|
49
49
|
@client = ::Slack::Web::Client.new
|
|
50
|
-
@client.chat_postMessage(
|
|
51
|
-
channel: "U03Q3PPSX",
|
|
52
|
-
as_user: false,
|
|
53
|
-
text: "2020/07/27 15:00からの面接よろしくお願いします!!1",
|
|
54
|
-
attachments: [{
|
|
55
|
-
fields: [
|
|
56
|
-
{
|
|
57
|
-
title: '区分',
|
|
58
|
-
value: "圧倒的P山採用"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
title: 'url',
|
|
62
|
-
value: "dummy"
|
|
63
|
-
}
|
|
64
|
-
],
|
|
65
|
-
color: 'warning'
|
|
66
|
-
}]
|
|
67
|
-
)
|
|
68
|
-
|
|
69
50
|
if ENV['TALENTIO_TEST']
|
|
70
51
|
@client.define_singleton_method(:chat_postMessage) do |m|
|
|
71
52
|
puts m
|
|
@@ -12,8 +12,8 @@ module Talentio
|
|
|
12
12
|
# 面接が行われていないものはスキップする
|
|
13
13
|
return unless data[:scheduled_at]
|
|
14
14
|
|
|
15
|
-
base_time =
|
|
16
|
-
diff = base_time.to_i -
|
|
15
|
+
base_time = Time.parse(data[:scheduled_at])
|
|
16
|
+
diff = base_time.to_i - Time.now.to_i
|
|
17
17
|
|
|
18
18
|
# 10分毎にcronで実行される想定
|
|
19
19
|
if (diff < (ENV['TALENTIO_REMIND_INTERVAL'] || 600) && diff >= 0)
|
|
@@ -16,16 +16,16 @@ module Talentio
|
|
|
16
16
|
return unless data[param[:limit_key]]
|
|
17
17
|
|
|
18
18
|
# 登録当日はスキップする
|
|
19
|
-
base_time =
|
|
20
|
-
return if base_time >= Date.today
|
|
19
|
+
base_time = Time.parse(data[param[:limit_key]])
|
|
20
|
+
return if base_time >= Date.today.to_time
|
|
21
21
|
|
|
22
22
|
slack_mentions = client.mention_id_from_evaluations(data[:evaluations])
|
|
23
23
|
slack_mentions.each do |m|
|
|
24
|
-
limit_day = base_time + param[:limit_day]
|
|
24
|
+
limit_day = base_time + param[:limit_day] * (60*60*24)
|
|
25
25
|
# 納期を設定する
|
|
26
26
|
loop do
|
|
27
27
|
break if ![0, 6].include?(limit_day.wday) && !HolidayJp.holiday?(limit_day)
|
|
28
|
-
limit_day = limit_day +
|
|
28
|
+
limit_day = limit_day + (60*60*24)
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
# 個別の通知はトークで実行するので、共有チャンネルに動いたことを通知する
|
data/manifests/cron.yml
CHANGED
|
@@ -10,7 +10,8 @@ spec:
|
|
|
10
10
|
spec:
|
|
11
11
|
containers:
|
|
12
12
|
- name: talentio-notifier
|
|
13
|
-
image: pyama/talentio-notifier:0.3.
|
|
13
|
+
image: pyama/talentio-notifier:0.3.5
|
|
14
|
+
imagePullPolicy: Always
|
|
14
15
|
env:
|
|
15
16
|
- name: LANG
|
|
16
17
|
value: C.UTF-8
|
|
@@ -29,7 +30,7 @@ spec:
|
|
|
29
30
|
args:
|
|
30
31
|
- "/bin/bash"
|
|
31
32
|
- "-c"
|
|
32
|
-
- "jpholidayp/jpholidayp || talentio-notifier remind-
|
|
33
|
+
- "jpholidayp/jpholidayp || talentio-notifier remind-result"
|
|
33
34
|
restartPolicy: Never
|
|
34
35
|
---
|
|
35
36
|
apiVersion: batch/v1beta1
|
|
@@ -44,7 +45,7 @@ spec:
|
|
|
44
45
|
spec:
|
|
45
46
|
containers:
|
|
46
47
|
- name: talentio-notifier
|
|
47
|
-
image: pyama/talentio-notifier:0.3.
|
|
48
|
+
image: pyama/talentio-notifier:0.3.5
|
|
48
49
|
env:
|
|
49
50
|
- name: TALENTIO_SKIP_STAGE
|
|
50
51
|
value: "3"
|
data/talentio-notifier.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: talentio-notifier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- pyama86
|
|
@@ -80,6 +80,20 @@ dependencies:
|
|
|
80
80
|
- - ">="
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: '0'
|
|
83
|
+
- !ruby/object:Gem::Dependency
|
|
84
|
+
name: activesupport
|
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '0'
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '0'
|
|
83
97
|
description: nofity command for talentio.
|
|
84
98
|
email:
|
|
85
99
|
- pyama@pepabo.com
|