open-dock 0.1.6 → 0.1.7

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
  SHA1:
3
- metadata.gz: a90f4844b63083092eb249348d863db04035369a
4
- data.tar.gz: f9ce5ecc98239076bb0de40231840a4297c6f314
3
+ metadata.gz: 8340dc1d9ed30ab838684a200392cd8fd4f2140c
4
+ data.tar.gz: 59be740879ae8b0d20f1922aa50e2e18b836fcbb
5
5
  SHA512:
6
- metadata.gz: 168c4982f31df7b36926b837d3d8a5145a52e55d625406906fc95b26702a533f06783f8eac248acd580a81e1e83be5d40766a276e1e5e18561b7ee77306185f8
7
- data.tar.gz: 390c024ee53331ea76cd60aa263f71437a3c64584633449abb0d7dc5afc8b2557fe41d6f4d35892bdfe77335aca414f7e49c091e19c4d5184cbe767bd0feaab2
6
+ metadata.gz: 8088a4120fee8f554b61666acf1d07c85baa17e1c6b84dc1c0c70d27a3a5d4fced83285036541dddab319bd7ab6716b349912b2b6477de15cc600a6a8b9a0a21
7
+ data.tar.gz: 97a4f66849cf3c9d42dc10c3240aafa25a13d01af092c429607f7a97ea1bcf062beb39543332b1d95bce1d5f34de3c1087c3a4ead5aeb099ba98a24c684bdc78
data/README.md CHANGED
@@ -88,6 +88,8 @@ Helpful commands:
88
88
  * `ops list digital_ocean` list all possible parameter values to use in the yml file
89
89
  * `ops create example.com` will create your host
90
90
 
91
+ By default `user` to connect to host will be 'root' if not configured.
92
+
91
93
  ### Digital Ocean Host
92
94
 
93
95
  For a Digital Ocean host we can make the following file (ops/hosts/example.com.yml):
@@ -126,7 +128,7 @@ In this file we can configure all containers to run in the host provided in the
126
128
 
127
129
  ```yml
128
130
  www:
129
- hostname: lebrijo.com
131
+ hostname: example.com
130
132
  image: jlebrijo/prun
131
133
  ports:
132
134
  - '2222:22'
@@ -2,15 +2,16 @@ module Ops
2
2
  HOSTS_DIR = "hosts"
3
3
  CONTAINERS_DIR = "containers"
4
4
  PROVIDERS_DIR = "providers"
5
-
5
+ DEFAULT_USER = "root"
6
6
 
7
7
  def self.get_user_for(host_name)
8
8
  host_file = "#{HOSTS_DIR}/#{host_name}.yml"
9
- begin
9
+ if File.exist? host_file
10
10
  params = YAML.load_file host_file
11
- params["user"]
12
- rescue
13
- raise "Please, create '#{host_file}' configuring your host"
11
+ if params and params.has_key? "user"
12
+ return params["user"]
13
+ end
14
14
  end
15
+ return DEFAULT_USER
15
16
  end
16
17
  end
@@ -7,7 +7,7 @@ command :configure do |c|
7
7
  c.action do |args, options|
8
8
  options.default container: 'all'
9
9
  host = args[0]
10
- user = Docker::DEFAULT_USER
10
+ user = Ops::DEFAULT_USER
11
11
  containers = Docker::containers_for(host)
12
12
 
13
13
  if options.container == "all"
@@ -6,7 +6,7 @@ command :ssh do |c|
6
6
  c.example "Connects to a container:", 'ops ssh example.com www'
7
7
  c.action do |args, options|
8
8
  host = args[0]
9
- user = Docker::DEFAULT_USER
9
+ user = Ops::DEFAULT_USER
10
10
 
11
11
  if args.count == 1
12
12
  ssh_port = 22
@@ -3,7 +3,6 @@ require 'yaml'
3
3
 
4
4
  module Docker
5
5
  SPECIAL_OPTS = ["image", "ports", "command", "post-conditions"]
6
- DEFAULT_USER = "root"
7
6
 
8
7
  def self.containers_for(host_name)
9
8
  config_file = "#{Ops::CONTAINERS_DIR}/#{host_name}.yml"
@@ -7,7 +7,7 @@ class Provider
7
7
  begin
8
8
  config = YAML.load_file config_file
9
9
  rescue
10
- raise "Please, create '#{config_file}' file following gem instrunctions"
10
+ raise "Please, create '#{config_file}' file following gem instructions"
11
11
  end
12
12
  create_connection config
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module OpenDock
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open-dock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Lebrijo