barbeque 2.0.1 → 2.1.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
- SHA1:
3
- metadata.gz: 97319e09ca3ea34d2026ad845e4ba1d0552939fd
4
- data.tar.gz: d97fe80c057637486eb31506976a17eba29a1532
2
+ SHA256:
3
+ metadata.gz: 55e5ddccef50d8012d519620dec44f063f85f29b399bc6eb4a9a540b4df31821
4
+ data.tar.gz: 7a05fba8fd639bd69c6f9dacb95cfe2d4304ff18723f13eda6d6dc7a8f8e09f9
5
5
  SHA512:
6
- metadata.gz: e43368a6ae848bc2a38256f34789d6b8d04a52fcf1c3cea76f2fe5a785171076065aff168d096edce2fc80cf12af8aaa205d24bdbd5b65613772b06f392fd57e
7
- data.tar.gz: e663effa9d01a89915e99bc4002f54722d27bc6bce5677228ca732360b78d12b75d8cbe152e2261d5b53bad80c84ffcdc5934f3d143bfb4eeff87554150ceb64
6
+ metadata.gz: 826610de1fa826d2478307188ffd96ad7f7a73d039556261cf07998ece853c9b68cd95ed8ed7f3034f519d63d69674b5aa3fbfef65a08cd3d179bb21e0fc8992
7
+ data.tar.gz: 14aba5a62e4a4150463de75a357641012eddcb964c889b5820eabd42c95f0caec971298473d5b7b1977989c1297898b53b5bc602b9c015a22b217f2220d7e2d5
data/README.md CHANGED
@@ -7,8 +7,7 @@ Job queue system to run job with Docker
7
7
 
8
8
  ## Project Status
9
9
 
10
- Barbeque is under development but already used on production at Cookpad.
11
- Documentation is work in progress.
10
+ Barbeque is used on production at Cookpad.
12
11
 
13
12
  ## What's Barbeque?
14
13
 
@@ -14,11 +14,20 @@ module Barbeque
14
14
 
15
15
  # @param [String] hako_dir
16
16
  # @param [Hash] hako_env
17
- # @param [String] yaml_dir
18
- def initialize(hako_dir:, hako_env: {}, yaml_dir:, oneshot_notification_prefix:)
17
+ # @param [String] definition_dir
18
+ # @param [String] yaml_dir (deprecated: renamed to definition_dir)
19
+ def initialize(hako_dir:, hako_env: {}, yaml_dir: nil, definition_dir: nil, oneshot_notification_prefix:)
19
20
  @hako_dir = hako_dir
20
21
  @hako_env = hako_env
21
- @yaml_dir = yaml_dir
22
+ @definition_dir =
23
+ if definition_dir
24
+ definition_dir
25
+ elsif yaml_dir
26
+ warn 'yaml_dir option is renamed to definition_dir. Please update config/barbeque.yml'
27
+ yaml_dir
28
+ else
29
+ raise ArgumentError.new('definition_dir is required')
30
+ end
22
31
  @hako_s3_client = HakoS3Client.new(oneshot_notification_prefix)
23
32
  end
24
33
 
@@ -104,10 +113,19 @@ module Barbeque
104
113
  private
105
114
 
106
115
  def build_hako_oneshot_command(docker_image, command, envs)
107
- [
108
- 'bundle', 'exec', 'hako', 'oneshot', '--no-wait', '--tag', docker_image.tag,
109
- *env_options(envs), File.join(@yaml_dir, "#{docker_image.repository}.yml"), '--', *command,
110
- ]
116
+ jsonnet_path = File.join(@definition_dir, "#{docker_image.repository}.jsonnet")
117
+ yaml_path = File.join(@definition_dir, "#{docker_image.repository}.yml")
118
+
119
+ cmd = ['bundle', 'exec', 'hako', 'oneshot', '--no-wait', '--tag', docker_image.tag, *env_options(envs)]
120
+ if File.readable?(jsonnet_path)
121
+ cmd << jsonnet_path
122
+ elsif File.readable?(yaml_path)
123
+ cmd << yaml_path
124
+ else
125
+ raise HakoCommandError.new("No definition found matching '#{docker_image.repository}' in #{@definition_dir}")
126
+ end
127
+ cmd << '--'
128
+ cmd.concat(command)
111
129
  end
112
130
 
113
131
  def env_options(envs)
@@ -1,3 +1,3 @@
1
1
  module Barbeque
2
- VERSION = '2.0.1'
2
+ VERSION = '2.1.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: barbeque
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-04 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: adminlte2-rails
@@ -470,7 +470,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
470
470
  version: '0'
471
471
  requirements: []
472
472
  rubyforge_project:
473
- rubygems_version: 2.6.11
473
+ rubygems_version: 2.7.3
474
474
  signing_key:
475
475
  specification_version: 4
476
476
  summary: Job queue system to run job with Docker