talentio-notifier 0.1.0 → 0.3.3

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: df54217a77db2ecd1a6f947a2a3de15f26a70db283d69d1194c644ffbc4c82c7
4
- data.tar.gz: a353b6d1a5c6ac07cceebea855212a40bad188502fbfdbdf998723bb0cf643c4
3
+ metadata.gz: 36e5f675dccc46f19602ae75bead46aebf66918e56aed012390887863cb6bb5d
4
+ data.tar.gz: 2810b152e21c90bd484eafd8173798bf43d6f11ec0af9cdd4addf3f3cb7c1cf3
5
5
  SHA512:
6
- metadata.gz: cfff5175d7ae302a191d10efc1bcb8fa6cd49179f62d4e427506c4e0b0dddd6845647f33be40647d9856ba104f40a6b0464b110e8fdb472833402176cc17b783
7
- data.tar.gz: 43acca98a0e68f0a09efe0cf3953bca2b12e45559126d5d27c0681b824a762c24fb54732b7694b3e5217b0228231d04d365a64e5591550fbd0119aae89ec2415
6
+ metadata.gz: 9c99ce5e78a55245d4d65b13ed0321458ddd9d34efb9cd08246dd302808613baeb1c973fe2dcd88d314c284b3c15e3cc4e4b66ff85c0ee9a6005f125aa3adfea
7
+ data.tar.gz: 73bacf2346a0d81866f8f3668c8bbbf7f7835731320efdddd61050def675e52ee6623b0f4a20a8e25fa228cc1413c5b37e2ebaeffbd6c9526997a84261b30df1
data/Dockerfile CHANGED
@@ -1,6 +1,6 @@
1
- FROM ruby:latest
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
6
+ RUN gem install talentio-notifier -v "0.3.3"
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- talentio-notifier (0.1.0)
4
+ talentio-notifier (0.3.3)
5
+ activesupport
5
6
  faraday
6
7
  holiday_jp
7
8
  slack-api
@@ -11,7 +12,7 @@ PATH
11
12
  GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
14
- activesupport (6.0.3.2)
15
+ activesupport (6.0.3.3)
15
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
16
17
  i18n (>= 0.7, < 2)
17
18
  minitest (~> 5.1)
data/Makefile CHANGED
@@ -1,8 +1,7 @@
1
- VERSION=0.0.1
1
+ VERSION=0.3.3
2
2
  build:
3
3
  docker build -t talentio-notifier .
4
4
 
5
5
  push: build
6
6
  docker tag talentio-notifier pyama/talentio-notifier:$(VERSION)
7
7
  docker push pyama/talentio-notifier:$(VERSION)
8
- sed -i 's/talentio-notifier:*/talentio-notifier:$(VERSION)/g' manifests/cron.yml
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キーなどは環境変数で指定してください。
@@ -39,6 +47,8 @@ talentioのAPIキーを指定してください。
39
47
  インタビュー通知のcron間隔に合わせて秒で指定してください。デフォルトで600(10分)です。
40
48
  - TELENTIO_SLACK_CHANNEL
41
49
  トークで通知したことを通知するチャンネル指定です。デフォルトは `#recruiting` です。
50
+ - TALENTIO_TEST
51
+ 何かしらの値を設定するとSlack通知を行わずに、標準出力を行います。動作確認したいときにご利用ください。
42
52
 
43
53
  ## Contributing
44
54
 
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "talentio-notifier"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'talentio'
4
+ require 'talentio/cli'
5
+
6
+ Talentio::CLI.start(ARGV)
@@ -3,6 +3,7 @@ require 'json'
3
3
  require 'pp'
4
4
  require 'slack'
5
5
  require 'holiday_jp'
6
+ require 'active_support/core_ext/module'
6
7
  module Talentio
7
8
  module Notifier
8
9
  class Slack
@@ -12,8 +12,8 @@ module Talentio
12
12
  # 面接が行われていないものはスキップする
13
13
  return unless data[:scheduled_at]
14
14
 
15
- base_time = DateTime.parse(data[:scheduled_at])
16
- diff = base_time.to_i - DateTime.now.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 = DateTime.parse(data[param[:limit_key]])
19
+ base_time = Time.parse(data[param[:limit_key]])
20
20
  return if base_time >= Date.today
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 + 1
28
+ limit_day = limit_day + (60*60*24)
29
29
  end
30
30
 
31
31
  # 個別の通知はトークで実行するので、共有チャンネルに動いたことを通知する
@@ -1,5 +1,5 @@
1
1
  module Talentio
2
2
  module Notifier
3
- VERSION = "0.1.0"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
@@ -3,14 +3,15 @@ kind: CronJob
3
3
  metadata:
4
4
  name: talentio-notifier-result
5
5
  spec:
6
- schedule: "0 11,15 * * 1-5"
6
+ schedule: "0 11,15 22 * 1-5"
7
7
  jobTemplate:
8
8
  spec:
9
9
  template:
10
10
  spec:
11
11
  containers:
12
12
  - name: talentio-notifier
13
- image: pyama/talentio-notifier:0.0.1
13
+ image: pyama/talentio-notifier:0.3.3
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-resullt"
33
+ - "jpholidayp/jpholidayp || talentio-notifier remind-result"
33
34
  restartPolicy: Never
34
35
  ---
35
36
  apiVersion: batch/v1beta1
@@ -44,10 +45,10 @@ spec:
44
45
  spec:
45
46
  containers:
46
47
  - name: talentio-notifier
47
- image: pyama/talentio-notifier:0.0.1
48
+ image: pyama/talentio-notifier:0.3.3
48
49
  env:
49
50
  - name: TALENTIO_SKIP_STAGE
50
- value: 3
51
+ value: "3"
51
52
  - name: LANG
52
53
  value: C.UTF-8
53
54
  - name: TALENTIO_APIKEY
@@ -19,7 +19,6 @@ Gem::Specification.new do |spec|
19
19
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
20
20
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
21
  end
22
- spec.bindir = "bin"
23
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
23
  spec.require_paths = ["lib"]
25
24
  spec.add_dependency "thor"
@@ -27,4 +26,5 @@ Gem::Specification.new do |spec|
27
26
  spec.add_dependency 'slack-api'
28
27
  spec.add_dependency 'slack-ruby-client'
29
28
  spec.add_dependency "holiday_jp"
29
+ spec.add_dependency "activesupport"
30
30
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: talentio-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-22 00:00:00.000000000 Z
11
+ date: 2020-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -80,10 +80,25 @@ 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
86
- executables: []
100
+ executables:
101
+ - talentio-notifier
87
102
  extensions: []
88
103
  extra_rdoc_files: []
89
104
  files:
@@ -97,7 +112,10 @@ files:
97
112
  - Makefile
98
113
  - README.md
99
114
  - Rakefile
115
+ - bin/console
116
+ - bin/setup
100
117
  - bin/talentio-notifier
118
+ - exe/talentio-notifier
101
119
  - lib/talentio.rb
102
120
  - lib/talentio/cli.rb
103
121
  - lib/talentio/client.rb