open-dock 0.0.10 → 0.0.11
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 +4 -4
- data/README.md +21 -13
- data/lib/open-dock/base.rb +3 -4
- data/lib/open-dock/commands/create_host.rb +4 -4
- data/lib/open-dock/commands/delete_host.rb +4 -4
- data/lib/open-dock/commands/exec_host.rb +2 -2
- data/lib/open-dock/commands/list.rb +1 -1
- data/lib/open-dock/commands/provision_host.rb +5 -5
- data/lib/open-dock/commands/ship_host.rb +1 -1
- data/lib/open-dock/commands/unship_host.rb +3 -3
- data/lib/open-dock/digitalocean.rb +1 -1
- data/lib/open-dock/version.rb +1 -1
- metadata +2 -4
- data/lib/open-dock/commands/create_domain.rb +0 -16
- data/lib/open-dock/commands/delete_domain.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0adfec5e763895571e01df92633b9c0837ca43e
|
4
|
+
data.tar.gz: 2e38e9c10e5c72b36a03109602d44df063b01e20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80fdc958ec610413d0363e862784daabc354a769fdc051d41aad0ba812d7abe27fa6ee9c2c57745a8b0da9645acc9ffbd73842225ca398e327d4d04070580e6c
|
7
|
+
data.tar.gz: dacca85a84533b8542c3e846379d43342b605144a52e57ec287ea6651a14e8cf3b7f330dddca2bcf85008f0867eb8c9c1963c3f5f3cd6edacbcae6b879802cfb
|
data/README.md
CHANGED
@@ -126,23 +126,25 @@ www:
|
|
126
126
|
|
127
127
|
Create containers at host: `ops ship host example.com`
|
128
128
|
|
129
|
-
###
|
129
|
+
### TODO: Configuration with Chef
|
130
130
|
|
131
|
-
|
131
|
+
Configuration with chef commands
|
132
132
|
|
133
|
-
* `ops
|
134
|
-
*
|
135
|
-
* `ops create domain DOMAIN_NAME [IP_ADDRESS]` create a domain to be managed by DigitalOcean.
|
136
|
-
* `ops delete domain DOMAIN_NAME [IP_ADDRESS]`
|
137
|
-
* `ops ship host HOST_NAME` run the containers in the host.
|
138
|
-
* `ops unship host HOST_NAME`
|
133
|
+
* `ops configure CONTAINER_NAME HOST_NAME`: configure with chef a container in host. Here you need to install knife-solo gem.
|
134
|
+
* knife solo cook [container_user]@[HOST_NAME] -p [container_ssh_port]
|
139
135
|
|
140
|
-
###
|
136
|
+
### Commands
|
141
137
|
|
142
|
-
|
138
|
+
Create/delete domain names, create/delete hosts and ship/unship hosts:
|
139
|
+
|
140
|
+
* `ops create HOST_NAME` create the host defined by the name of the file in the 'ops/hosts' folder.
|
141
|
+
* `ops delete HOST_NAME`
|
142
|
+
* TODO: `ops recreate HOST_NAME` delete/create the host.
|
143
|
+
* `ops ship HOST_NAME` run the containers in the host.
|
144
|
+
* `ops unship HOST_NAME`
|
145
|
+
* TODO: `ops reship HOST_NAME` unship/ship all containers from host.
|
146
|
+
* TODO: `ops configure CONTAINER_NAME HOST_NAME` configure container with chef.
|
143
147
|
|
144
|
-
* `ops configure host HOST_NAME`: configure with chef all containers in host. Here you need to install knife-solo gem.
|
145
|
-
* knife solo cook [container_user]@[container_dns_name] -p [container_ssh_port]
|
146
148
|
|
147
149
|
## Contributing
|
148
150
|
|
@@ -160,4 +162,10 @@ Configuration with chef commands
|
|
160
162
|
|
161
163
|
### v0.0.10
|
162
164
|
|
163
|
-
* First publication: split 'open-dock' gem from 'prun-ops' gem
|
165
|
+
* First publication: split 'open-dock' gem from 'prun-ops' gem
|
166
|
+
|
167
|
+
### v0.0.11
|
168
|
+
|
169
|
+
* Remove create/delete domain commands
|
170
|
+
* Remove "host" word from all commands
|
171
|
+
* Remove /ops folder from providers, hosts and containers subfolders
|
data/lib/open-dock/base.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
command :
|
2
|
-
c.summary = 'Create a droplet/host in your
|
3
|
-
c.syntax = 'ops create
|
1
|
+
command :create do |c|
|
2
|
+
c.summary = 'Create a droplet/host in your provider account'
|
3
|
+
c.syntax = 'ops create [DNS_name]'
|
4
4
|
c.description = "Creates the host described in the file #{Ops::HOSTS_DIR}/[DNS_name].yml"
|
5
|
-
c.example "Create the host example.com in your DigitalOcean console. This is described in '#{Ops::HOSTS_DIR}/example.com.yml' like:\n # size: 512mb\n # region: ams1\n # image: coreos-stable\n # ssh_keys:\n # - e7:51:47:bc:7f:dc:2f:3c:56:65:28:e1:10:9c:88:57 xx:xx:xx:xx:xx:xx:xx", 'ops create
|
5
|
+
c.example "Create the host example.com in your DigitalOcean console. This is described in '#{Ops::HOSTS_DIR}/example.com.yml' like:\n # size: 512mb\n # region: ams1\n # image: coreos-stable\n # ssh_keys:\n # - e7:51:47:bc:7f:dc:2f:3c:56:65:28:e1:10:9c:88:57 xx:xx:xx:xx:xx:xx:xx", 'ops create example.com'
|
6
6
|
c.action do |args, options|
|
7
7
|
droplet = DigitalOcean::build_droplet args[0]
|
8
8
|
cli = DigitalOcean::client
|
@@ -1,8 +1,8 @@
|
|
1
|
-
command :
|
2
|
-
c.summary = 'Delete a host in your
|
3
|
-
c.syntax = 'ops delete
|
1
|
+
command :delete do |c|
|
2
|
+
c.summary = 'Delete a host in your provider account'
|
3
|
+
c.syntax = 'ops delete [DNS_name]'
|
4
4
|
c.description = "Delete the host, based on DNS_name, which (not need but) should be described in its #{Ops::HOSTS_DIR}/[DNS_name].yml file "
|
5
|
-
c.example 'Delete the host example.com in your DigitalOcean console', 'ops delete
|
5
|
+
c.example 'Delete the host example.com in your DigitalOcean console', 'ops delete example.com'
|
6
6
|
c.action do |args, options|
|
7
7
|
cli = DigitalOcean::client
|
8
8
|
id = cli.find_droplet_by_name(args[0]).id
|
@@ -1,8 +1,8 @@
|
|
1
1
|
command :'exec host' do |c|
|
2
2
|
c.summary = 'Execute a command in host'
|
3
3
|
c.description = "Execute a command in host defined by DNS_name"
|
4
|
-
c.syntax = 'ops exec
|
5
|
-
c.example "", "ops exec
|
4
|
+
c.syntax = 'ops exec [host_name] "[command]"'
|
5
|
+
c.example "List containers in host", "ops exec example.com 'docker ps -a'"
|
6
6
|
c.action do |args, options|
|
7
7
|
host = args[0]
|
8
8
|
user = Ops::get_user_for(host)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
command :list do |c|
|
2
2
|
c.summary = 'List all droplet creation parameters'
|
3
3
|
c.syntax = 'ops list'
|
4
|
-
c.description = "This shows a list in the format '- [id] => [description]'. Use [id] values to create your host file in #{Ops::
|
4
|
+
c.description = "This shows a list in the format '- [id] => [description]'. Use [id] values to create your host file in #{Ops::HOSTS_DIR}[dns_name].yml "
|
5
5
|
c.action do |args, options|
|
6
6
|
cli = DigitalOcean::client
|
7
7
|
say "\nDESCRIPTION: #{c.description}\n"
|
@@ -1,11 +1,11 @@
|
|
1
|
-
command :
|
1
|
+
command :provision do |c|
|
2
2
|
c.summary = 'Create and ship the host based on config files'
|
3
|
-
c.syntax = 'ops provision
|
3
|
+
c.syntax = 'ops provision [host_name]'
|
4
4
|
c.description = "Agregate both commands Create and Ship host"
|
5
|
-
c.example "Creates and ships example.com host", 'ops provisiion
|
5
|
+
c.example "Creates and ships example.com host", 'ops provisiion example.com'
|
6
6
|
c.action do |args, options|
|
7
|
-
system "#{program :name} create
|
7
|
+
system "#{program :name} create #{args.join(" ")}"
|
8
8
|
sleep 15
|
9
|
-
system "#{program :name} ship
|
9
|
+
system "#{program :name} ship #{args.join(" ")}"
|
10
10
|
end
|
11
11
|
end
|
@@ -2,7 +2,7 @@ command :'ship host' do |c|
|
|
2
2
|
c.summary = 'Create Docker containers defined in ops/containers/[host_name].yml'
|
3
3
|
c.syntax = 'ops ship host [host_name]'
|
4
4
|
c.description = "Create all docker containers described in #{Ops::CONTAINERS_DIR}/[host_name].yml"
|
5
|
-
c.example "Create a container called 'www' in the host example.com. This is described in '#{Ops::CONTAINERS_DIR}/example.com.yml' like:\n # www:\n # detach: true\n # image: jlebrijo/prun\n # ports:\n # - '2222:22'\n # - '80:80'", 'ops ship
|
5
|
+
c.example "Create a container called 'www' in the host example.com. This is described in '#{Ops::CONTAINERS_DIR}/example.com.yml' like:\n # www:\n # detach: true\n # image: jlebrijo/prun\n # ports:\n # - '2222:22'\n # - '80:80'", 'ops ship example.com'
|
6
6
|
c.action do |args, options|
|
7
7
|
host = args[0]
|
8
8
|
user = Ops::get_user_for(host)
|
@@ -1,8 +1,8 @@
|
|
1
|
-
command :
|
1
|
+
command :unship do |c|
|
2
2
|
c.summary = 'Removes all Docker containers defined for the host in '#{Ops::CONTAINERS_DIR}/[host_name].yml'
|
3
|
-
c.syntax = 'ops ship
|
3
|
+
c.syntax = 'ops ship [host_name]'
|
4
4
|
c.description = "Removes all Docker containers defined for the host in '#{Ops::CONTAINERS_DIR}/[host_name].yml"
|
5
|
-
c.example "", 'ops unship
|
5
|
+
c.example "", 'ops unship example.com'
|
6
6
|
c.action do |args, options|
|
7
7
|
host = args[0]
|
8
8
|
user = Ops::get_user_for(host)
|
@@ -15,7 +15,7 @@ module DigitalOcean
|
|
15
15
|
|
16
16
|
def self.build_droplet(host_name)
|
17
17
|
begin
|
18
|
-
params = YAML.load_file "#{Ops::
|
18
|
+
params = YAML.load_file "#{Ops::HOSTS_DIR}/#{host_name}.yml"
|
19
19
|
params["name"]= host_name
|
20
20
|
rescue
|
21
21
|
raise "Please, create '#{CONFIG_FILE}' file with token value"
|
data/lib/open-dock/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open-dock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juan Lebrijo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -84,9 +84,7 @@ files:
|
|
84
84
|
- bin/ops
|
85
85
|
- lib/open-dock.rb
|
86
86
|
- lib/open-dock/base.rb
|
87
|
-
- lib/open-dock/commands/create_domain.rb
|
88
87
|
- lib/open-dock/commands/create_host.rb
|
89
|
-
- lib/open-dock/commands/delete_domain.rb
|
90
88
|
- lib/open-dock/commands/delete_host.rb
|
91
89
|
- lib/open-dock/commands/exec_host.rb
|
92
90
|
- lib/open-dock/commands/list.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
command :'create domain' do |c|
|
2
|
-
c.summary = 'Create a domain in your DigitalOcean account'
|
3
|
-
c.syntax = 'ops create domain [domain name] [ip address]'
|
4
|
-
c.description = "Create the domain with #{DigitalOcean::CONFIG_FILE} credentials"
|
5
|
-
c.example 'Create the domain example.com in your DigitalOcean console', 'ops create domain example.com'
|
6
|
-
c.action do |args, options|
|
7
|
-
ip = (args[1].nil?)? '1.1.1.1':args[1]
|
8
|
-
domain = DropletKit::Domain.new(ip_address: ip, name: args[0])
|
9
|
-
resp = DigitalOcean::client.domains.create domain
|
10
|
-
if domain == resp
|
11
|
-
say "Domain #{resp.name} succesfully created!"
|
12
|
-
else
|
13
|
-
raise resp
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
command :'delete domain' do |c|
|
2
|
-
c.summary = 'Delete a domain in your DigitalOcean account'
|
3
|
-
c.syntax = 'ops delete domain [domain name]'
|
4
|
-
c.description = "Delete the domain with #{DigitalOcean::CONFIG_FILE} credentials"
|
5
|
-
c.example 'Delete the domain example.com in your DigitalOcean console', 'ops delete domain example.com'
|
6
|
-
c.action do |args, options|
|
7
|
-
resp = DigitalOcean::client.domains.delete name: args[0]
|
8
|
-
if resp.is_a?(TrueClass)
|
9
|
-
say "Domain #{args[0]} succesfully deleted!"
|
10
|
-
else
|
11
|
-
raise resp
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|