conjur-debify 1.3.1 → 1.4.0

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
  SHA1:
3
- metadata.gz: 9cfd1a8c7590e68df545ee14205ebc86a695f636
4
- data.tar.gz: 8951e64bfe8ab43dada0ed964bf0b1985679a73a
3
+ metadata.gz: 7c57a4e9688bb87a40ad356edb08469a8090ab22
4
+ data.tar.gz: 9ef86713510df115a32bc972117d7f46a9b1c5cc
5
5
  SHA512:
6
- metadata.gz: 2c3c5de841eb1a8e14666da2f02a623d85ced3a2a72e99bc5d5fb4eb2bced96e38415c59ac42d2105aa81b20c45af4fb063825293f7ffd46811d465727409e14
7
- data.tar.gz: 36ae0244afe85132741d13e867d477ed43a83bee52faf27ca439ec2f02fdadc369536fcbdf10bce1ac8cef79726bbc0b55787f1d6c78467497fe9f80c03d937f
6
+ metadata.gz: 8a189d86b8e9b4de1d5d3945f0ed77934cdfdeb8155cb3a3c87438b989368608090929ef5f8ad16caa38885b605c6e7439dfb2ac3bd56eefe4d7064ddf1aaf81
7
+ data.tar.gz: f7cc7725dbede77c5530d25da6ea8dd87ac7a95f3ed97e1092516a0a1ac8f933756de0034bd98664d272a9e66387b2c356cc6afbd1e0b6ae49723231eb4b77e4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 1.4.0
2
+
3
+ * Add `--port` sandbox option
4
+
1
5
  # 1.3.1
2
6
 
3
7
  * When testing, `docker exec` into the Conjur container to run
@@ -1,5 +1,5 @@
1
1
  module Conjur
2
2
  module Debify
3
- VERSION = "1.3.1"
3
+ VERSION = "1.4.0"
4
4
  end
5
5
  end
data/lib/conjur/debify.rb CHANGED
@@ -480,6 +480,9 @@ command "sandbox" do |c|
480
480
  c.desc "Specify volume for container"
481
481
  c.flag [ :'volumes-from' ], :multiple => true
482
482
 
483
+ c.desc "Expose a port from the container to host. Use <host>:<container>."
484
+ c.flag [ :p, :port ], :multiple => true
485
+
483
486
  c.desc 'Run dev-install in /src/<project-name>'
484
487
  c.default_value false
485
488
  c.switch [:'dev-install']
@@ -521,21 +524,33 @@ command "sandbox" do |c|
521
524
  "CONJUR_ENV=appliance",
522
525
  "CONJUR_AUTHN_API_KEY=secret",
523
526
  "CONJUR_ADMIN_PASSWORD=secret",
524
- ] + global_options[:env],
525
- 'Binds' => [
526
- [ File.expand_path(".ssh/id_rsa", ENV['HOME']), "/root/.ssh/id_rsa", 'ro' ].join(':'),
527
- [ dir, "/src/#{project_name}" ].join(':'),
528
- ] + Array(cmd_options[:bind])
527
+ ] + global_options[:env]
529
528
  }
529
+
530
+ options['HostConfig'] = host_config = {}
531
+ host_config['Binds'] = [
532
+ [ File.expand_path(".ssh/id_rsa", ENV['HOME']), "/root/.ssh/id_rsa", 'ro' ].join(':'),
533
+ [ dir, "/src/#{project_name}" ].join(':'),
534
+ ] + Array(cmd_options[:bind])
535
+
530
536
  if global_options[:'local-bundle']
531
- options['Binds']
537
+ host_config['Binds']
532
538
  .push([ vendor_dir, "/src/#{project_name}/vendor" ].join(':'))
533
539
  .push([ dot_bundle_dir, "/src/#{project_name}/.bundle" ].join(':'))
534
540
  end
535
541
 
536
- options['Privileged'] = true if Docker.version['Version'] >= '1.10.0'
537
- options['Links'] = cmd_options[:link] unless cmd_options[:link].empty?
538
- options['VolumesFrom'] = cmd_options[:'volumes-from'] unless cmd_options[:'volumes-from'].empty?
542
+ host_config['Privileged'] = true if Docker.version['Version'] >= '1.10.0'
543
+ host_config['Links'] = cmd_options[:link] unless cmd_options[:link].empty?
544
+ host_config['VolumesFrom'] = cmd_options[:'volumes-from'] unless cmd_options[:'volumes-from'].empty?
545
+
546
+ unless cmd_options[:port].empty?
547
+ port_bindings = Hash.new({})
548
+ cmd_options[:port].each do |mapping|
549
+ hport, cport = mapping.split(':')
550
+ port_bindings["#{cport}/tcp"] = [{ 'HostPort' => hport }]
551
+ end
552
+ host_config['PortBindings'] = port_bindings
553
+ end
539
554
 
540
555
  if cmd_options[:kill]
541
556
  previous = Docker::Container.get(options['name']) rescue nil
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conjur-debify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Gilpin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-28 00:00:00.000000000 Z
11
+ date: 2016-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli