cutlass 0.2.4 → 0.3.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
2
  SHA256:
3
- metadata.gz: 6555902fd7058aaec0bdb4c669acc36d23ba035502ae5fb89249540b0724ea00
4
- data.tar.gz: ea946967d973fcee7174fc1af7dcb62a8ee1eb3dbccdc03e3b3b7ab0d0256944
3
+ metadata.gz: 60df15fbdd7d8e5720584aac45b553e93eeb79fb72f78192ba06d51ec8b63a00
4
+ data.tar.gz: aea137a128750f7184f0bb5cfbd693957bd679dcda2b14e07b449b2611a801e1
5
5
  SHA512:
6
- metadata.gz: 32f68803319396154c70951215d67ca81450bf18f1965d0ce0c4f7ec31323c26924109579e3f729b1500b0b877eccdaf64158e43041af395fe2ff0597a0b0ee8
7
- data.tar.gz: b97e4ad58d2bda8d7925caee7ec8a058628e583ce4edee3bbf5716d4be673bd803bb209305ce6da56afccdb1b63feb98394bfa27ffd47fa95b7a5ff57f394f73
6
+ metadata.gz: 7c1a8c7b46f327e0859b06a1b1311e65f1e10ebd755ab222201059639743010b7071e84c850452f13d47c38f80b688fbb581b06dbb2356b590badd11b6094a53
7
+ data.tar.gz: c4a7289cbf891b6d258803957c2ecfb59a8ee4f590cb1ef1a9fecc5c7b91651844c1118e4a8bf397ee31dc9287454bba93c6a73689547e1bc86015405b950ce0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## 0.3.0
4
+
5
+ - Support :env option for start_container https://github.com/heroku/cutlass/pull/31
6
+
3
7
  ## 0.2.4
4
8
 
5
9
  - Expose container logs on actively running instances via ContainerControl https://github.com/heroku/cutlass/pull/29
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cutlass (0.2.4)
4
+ cutlass (0.3.0)
5
5
  docker-api (>= 2.0)
6
6
 
7
7
  GEM
@@ -17,7 +17,7 @@ GEM
17
17
  docker-api (2.2.0)
18
18
  excon (>= 0.47.0)
19
19
  multi_json
20
- excon (0.85.0)
20
+ excon (0.87.0)
21
21
  hashdiff (1.0.1)
22
22
  multi_json (1.15.0)
23
23
  parallel (1.20.1)
data/lib/cutlass/app.rb CHANGED
@@ -90,10 +90,15 @@ module Cutlass
90
90
  on_teardown { thread.join }
91
91
  end
92
92
 
93
- def start_container(memory: nil, expose_ports: [])
93
+ def start_container(env: {}, expose_ports: [], memory: nil)
94
94
  raise "No block given" unless block_given?
95
95
 
96
- ContainerBoot.new(image_id: last_build.image_id, memory: memory, expose_ports: expose_ports).call do |container|
96
+ ContainerBoot.new(
97
+ image_id: last_build.image_id,
98
+ env: env,
99
+ expose_ports: expose_ports,
100
+ memory: memory
101
+ ).call do |container|
97
102
  yield container
98
103
  end
99
104
  end
@@ -33,7 +33,7 @@ module Cutlass
33
33
  # container. It does not execute the container's entrypoint. That means if you're running
34
34
  # inside of a CNB image, that env vars won't be set and the directory might be different.
35
35
  class ContainerBoot
36
- def initialize(image_id:, expose_ports: [], memory: nil)
36
+ def initialize(image_id:, env: {}, expose_ports: [], memory: nil)
37
37
  @expose_ports = Array(expose_ports)
38
38
  config = {
39
39
  "Image" => image_id,
@@ -53,6 +53,7 @@ module Cutlass
53
53
  end
54
54
 
55
55
  config["Memory"] = memory.to_i if memory
56
+ config["Env"] = env.map { |k, v| "#{k}=#{v}" }
56
57
  @container = Docker::Container.create(config)
57
58
  end
58
59
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Cutlass
4
4
  # Version
5
- VERSION = "0.2.4"
5
+ VERSION = "0.3.0"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cutlass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - schneems
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-05 00:00:00.000000000 Z
11
+ date: 2021-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.2.22
95
+ rubygems_version: 3.1.4
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Write CNB integration tests for Pack in Ruby with cutlass