docker_deploy 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/docker_deploy/context.rb +3 -2
- data/lib/docker_deploy/stage.rb +6 -1
- data/lib/docker_deploy/task.rb +2 -2
- data/lib/docker_deploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f377e6e5c4f35c71eb78e3e3f1a43600ba7ace9
|
4
|
+
data.tar.gz: bd168fbc6d365ac6bb2d036f364cc2c6272e6aa8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c259e9d57c6d73f3d6774840a5265a00beeb5c2d6fdcc81a38b489a3d91419e39a9dac3318ef2caa672e797f72ff00e4c7d6896193e905b46694a0d5089d77
|
7
|
+
data.tar.gz: 529a1cd86771318527138c5928c58348aea4c65e354182b1ec0fcab1212cef09cf8575adb5f3573e2a92823de6e7f34e0618469e1c483f299ac4ad2899fe8f05
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Ruby applications.
|
|
8
8
|
Add this line to your application's Gemfile:
|
9
9
|
|
10
10
|
``` ruby
|
11
|
-
gem
|
11
|
+
gem "docker_deploy", require: false
|
12
12
|
```
|
13
13
|
|
14
14
|
## Usage
|
@@ -16,6 +16,8 @@ gem 'docker_deploy'
|
|
16
16
|
In your Rakefile define your deployment setup like this:
|
17
17
|
|
18
18
|
``` ruby
|
19
|
+
require "docker_deploy"
|
20
|
+
|
19
21
|
DockerDeploy.task do
|
20
22
|
image "elabs/projectpuzzle"
|
21
23
|
|
data/lib/docker_deploy/stage.rb
CHANGED
@@ -2,7 +2,7 @@ module DockerDeploy
|
|
2
2
|
class Stage
|
3
3
|
include Rake::FileUtilsExt
|
4
4
|
|
5
|
-
attr_reader :name, :servers, :variables, :links, :env_files, :deploy
|
5
|
+
attr_reader :name, :servers, :variables, :links, :env_files, :deploy, :container
|
6
6
|
|
7
7
|
def initialize(context, name)
|
8
8
|
@context = context
|
@@ -48,6 +48,11 @@ module DockerDeploy
|
|
48
48
|
format_params("-e %s=%s", @context.variables.merge(@variables))
|
49
49
|
end
|
50
50
|
|
51
|
+
def container(name = nil)
|
52
|
+
@container = name if name
|
53
|
+
@container or @context.container
|
54
|
+
end
|
55
|
+
|
51
56
|
private
|
52
57
|
|
53
58
|
def format_params(pattern, enumerable)
|
data/lib/docker_deploy/task.rb
CHANGED
@@ -31,12 +31,12 @@ module DockerDeploy
|
|
31
31
|
|
32
32
|
desc "Stop the application and remove its container"
|
33
33
|
task :stop do
|
34
|
-
stage.run "docker inspect #{
|
34
|
+
stage.run "docker inspect #{stage.container} 2>&1 > /dev/null && docker stop #{stage.container} && docker rm #{stage.container} || true"
|
35
35
|
end
|
36
36
|
|
37
37
|
desc "Start the application in a container using the latest image."
|
38
38
|
task :start do
|
39
|
-
stage.run "docker run -d #{stage.port_mappings} #{stage.link_mappings} #{stage.options} --name #{
|
39
|
+
stage.run "docker run -d #{stage.port_mappings} #{stage.link_mappings} #{stage.options} --name #{stage.container} #{context.image}:latest"
|
40
40
|
|
41
41
|
puts "\n\nStarted: #{stage.host}\n"
|
42
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docker_deploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Nicklas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-11-
|
12
|
+
date: 2014-11-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sshkit
|