freighter 0.2.2 → 0.2.3
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 +1 -1
- data/config/freighter.example.yml +22 -19
- data/freighter.gemspec +3 -3
- data/lib/freighter/deploy.rb +5 -2
- data/lib/freighter/version.rb +1 -1
- data/spec/lib/freighter/deploy_spec.rb +2 -2
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 092ef2407088b7808a5c4f99882ba9ffd20acfe7
|
4
|
+
data.tar.gz: a0bdad1daf34a8489128e7cd0b9a583d798d5fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c4a1e8ee406b4c00ad2238691fe6b5e57394d05b1d7145cee93ea3b30ef195f65fe88c00fd65cc8f4e75348c84f4dd0ff29380f1adcd1105996b3cb6ba76605
|
7
|
+
data.tar.gz: 04272a1762fb6d356e0c71a4cfab236de3e2401271e66eb7a04f21672ce686d9bf12258d554e41c174ead6cb1dc800b3e94b6367169377b6209d88828ef51036
|
data/README.md
CHANGED
@@ -31,27 +31,30 @@ environments:
|
|
31
31
|
shared_env: &shared_app_env
|
32
32
|
DB_USERNAME: fooBar
|
33
33
|
DB_PASSWORD: My53cr37
|
34
|
+
|
35
|
+
one_image: &one_image
|
36
|
+
name: organization/imageName:latest
|
37
|
+
containers:
|
38
|
+
- name: app
|
39
|
+
port_mapping: 0.0.0.0:80->80
|
40
|
+
env:
|
41
|
+
<<: *shared_app_env
|
42
|
+
ADDITIONAL_VAR: someValue
|
43
|
+
|
44
|
+
some_other_image: &other_image
|
45
|
+
name: organization/otherImage:latest
|
46
|
+
containers:
|
47
|
+
- name: otherApp
|
48
|
+
port_mapping: 0.0.0.0:2000->80
|
49
|
+
env:
|
50
|
+
<<: *shared_app_env
|
51
|
+
|
34
52
|
hosts:
|
35
53
|
- host: prod1.example.com
|
36
54
|
images:
|
37
|
-
-
|
38
|
-
|
39
|
-
- name: app
|
40
|
-
port_mapping: 0.0.0.0:80->80
|
41
|
-
env:
|
42
|
-
<<: *shared_app_env
|
43
|
-
ADDITIONAL_VAR: someValue
|
44
|
-
- name: organization/otherImage:latest
|
45
|
-
containers:
|
46
|
-
- name: otherApp
|
47
|
-
port_mapping: 0.0.0.0:2000->80
|
48
|
-
env:
|
49
|
-
<<: *shared_app_env
|
55
|
+
- *one_image
|
56
|
+
- *other_image
|
50
57
|
- host: prod2.example.com
|
51
58
|
images:
|
52
|
-
-
|
53
|
-
|
54
|
-
- name: otherApp
|
55
|
-
port_mapping: 0.0.0.0:2000->80
|
56
|
-
env:
|
57
|
-
<<: *shared_app_env
|
59
|
+
- *one_image
|
60
|
+
- *other_image
|
data/freighter.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = Freighter::VERSION
|
9
9
|
spec.authors = ["Sean McCleary"]
|
10
10
|
spec.email = ["seanmcc@gmail.com"]
|
11
|
-
spec.summary = %q{
|
12
|
-
spec.description = %q{
|
11
|
+
spec.summary = %q{Easily deploy docker containers via SSH}
|
12
|
+
spec.description = %q{Easily deploy docker containers via SSH}
|
13
13
|
spec.homepage = "https://github.com/mrinterweb/freighter"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency "net-ssh", "~> 2.9"
|
22
|
-
spec.add_dependency "docker-api", "
|
22
|
+
spec.add_dependency "docker-api", "1.20"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/freighter/deploy.rb
CHANGED
@@ -4,7 +4,7 @@ require 'thwait'
|
|
4
4
|
|
5
5
|
module Freighter
|
6
6
|
class Deploy
|
7
|
-
attr_reader :logger, :config
|
7
|
+
attr_reader :logger, :config
|
8
8
|
|
9
9
|
def initialize
|
10
10
|
@parser = Parser.new OPTIONS.config_path
|
@@ -113,6 +113,7 @@ module Freighter
|
|
113
113
|
# Sets up the Docker gem by setting the local URL and authenticating to the host's REST API
|
114
114
|
def setup_docker_client(local_port)
|
115
115
|
Docker.url = "http://localhost:#{local_port}"
|
116
|
+
Docker.connection.options[:scheme] = 'http'
|
116
117
|
begin
|
117
118
|
logger.debug "Requesting docker version"
|
118
119
|
response = Docker.version
|
@@ -121,7 +122,9 @@ module Freighter
|
|
121
122
|
response = Docker.authenticate!('username' => ENV['DOCKER_HUB_USER_NAME'], 'password' => ENV['DOCKER_HUB_PASSWORD'], 'email' => ENV['DOCKER_HUB_EMAIL'])
|
122
123
|
logger.debug "Docker authentication: #{response.inspect}"
|
123
124
|
rescue Excon::Errors::SocketError => e
|
124
|
-
|
125
|
+
abort e.message
|
126
|
+
rescue Exception => e
|
127
|
+
abort e.message
|
125
128
|
end
|
126
129
|
end
|
127
130
|
|
data/lib/freighter/version.rb
CHANGED
@@ -16,7 +16,7 @@ describe Freighter::Deploy do
|
|
16
16
|
|
17
17
|
it "should match port mapping with IP address" do
|
18
18
|
mapping = "0.0.0.0:80->90"
|
19
|
-
port_map = subject.send(:
|
19
|
+
port_map = subject.send(:map_ports, mapping)
|
20
20
|
expect(port_map.ip).to eq "0.0.0.0"
|
21
21
|
expect(port_map.host).to eq 80
|
22
22
|
expect(port_map.container).to eq 90
|
@@ -24,7 +24,7 @@ describe Freighter::Deploy do
|
|
24
24
|
|
25
25
|
it "should be able to accept a mapping without an IP address" do
|
26
26
|
mapping = "80->90"
|
27
|
-
port_map = subject.send(:
|
27
|
+
port_map = subject.send(:map_ports, mapping)
|
28
28
|
expect(port_map.ip).to be_nil
|
29
29
|
expect(port_map.host).to eq 80
|
30
30
|
expect(port_map.container).to eq 90
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: freighter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean McCleary
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: docker-api
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '='
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.20'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.20'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0.2'
|
111
|
-
description:
|
111
|
+
description: Easily deploy docker containers via SSH
|
112
112
|
email:
|
113
113
|
- seanmcc@gmail.com
|
114
114
|
executables:
|
@@ -156,11 +156,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
version: '0'
|
157
157
|
requirements: []
|
158
158
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.
|
159
|
+
rubygems_version: 2.4.6
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
|
-
summary:
|
162
|
+
summary: Easily deploy docker containers via SSH
|
163
163
|
test_files:
|
164
164
|
- spec/lib/freighter/deploy_spec.rb
|
165
165
|
- spec/lib/freighter/parser_spec.rb
|
166
166
|
- spec/spec_helper.rb
|
167
|
+
has_rdoc:
|