dockerploy 0.0.4 → 0.0.5
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 +8 -8
- data/README.md +46 -1
- data/lib/dockerploy/configuration.rb +5 -0
- data/lib/dockerploy/deploy.rb +2 -1
- data/lib/dockerploy/version.rb +1 -1
- data/spec/fixtures/config_with_image_tag.yml +17 -0
- data/spec/lib/dockerploy/deploy_spec.rb +13 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NGFjZGYwZmU4ZDE1MTMzYWI1MTg3MzkzOWZmOTUxMzRkNDQ0ZWE1NQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NTZmMThhYTUxZjMyYTRjNTMzODAwZDk2YTIzNzExMTFmNWJlMWM5ZA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YTI3YjJlN2U1YTNjMzFlMTkyNmUwYjQ1Yzg2NzVlODY1MTg4OGI4ODVlY2I1
|
|
10
|
+
MzRjMmE2NTIwMjgyNmE0YWFkYjk3ODZkY2EzMTM1NTk5NzUwYTUxMWYyMmYy
|
|
11
|
+
ZDg2ZGIzYzVmMGRiMzE1ODMxNTAwYzZhM2MyZTAxNDgxNWQxZTU=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
MmM3NzIzNWMwYmRmMjVlMGM2Y2U5YmU1NmM5YTI1NmEyODYwNGY4OWVlOGQ2
|
|
14
|
+
ZjBkNzE5YTIxY2U4ZDI5M2UxZWNmNzdiYjQxODg3NzNlMmEzMGRlYTMwODVm
|
|
15
|
+
MTBlNDljYWVmNGFkMzViOGIwMjY1ZTJiMWU3NGY2OGY3ZGNhNTY=
|
data/README.md
CHANGED
|
@@ -7,7 +7,11 @@ Deploy dockerized an application
|
|
|
7
7
|
|
|
8
8
|
Add this line to your application's Gemfile:
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
```ruby
|
|
11
|
+
group :development do
|
|
12
|
+
gem 'dockerploy'
|
|
13
|
+
end
|
|
14
|
+
```
|
|
11
15
|
|
|
12
16
|
And then execute:
|
|
13
17
|
|
|
@@ -17,6 +21,47 @@ Or install it yourself as:
|
|
|
17
21
|
|
|
18
22
|
$ gem install dockerploy
|
|
19
23
|
|
|
24
|
+
Generate an empty docker/config.yml with:
|
|
25
|
+
|
|
26
|
+
$ bundle exec dockerploy init
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
In docker/config.yml.
|
|
30
|
+
|
|
31
|
+
image_name: <Docker image name>
|
|
32
|
+
docker_username: <Docker registry server username>
|
|
33
|
+
docker_host: <Docker server for building>
|
|
34
|
+
application_name: <application name>
|
|
35
|
+
staging: # Environment name
|
|
36
|
+
env_file: docker/environments/staging.yml # Environment variable file path
|
|
37
|
+
tag: v1.0.7 # <Image tag>
|
|
38
|
+
hooks:
|
|
39
|
+
before_deploy:
|
|
40
|
+
- local:
|
|
41
|
+
- <Command to run in local machine>
|
|
42
|
+
- remote:
|
|
43
|
+
- <Command to run in remove machine(host server)>
|
|
44
|
+
after_deploy:
|
|
45
|
+
- local:
|
|
46
|
+
- <Command to run in local machine>
|
|
47
|
+
- remote:
|
|
48
|
+
- <Command to run in remove machine(host server)>
|
|
49
|
+
volumes:
|
|
50
|
+
- volume:
|
|
51
|
+
host: <Folder from the host>
|
|
52
|
+
guest: <Folder to the container>
|
|
53
|
+
servers:
|
|
54
|
+
- host: <Docker server>
|
|
55
|
+
username: <Server username>
|
|
56
|
+
password: <Server password>
|
|
57
|
+
port: <Server SSH port>
|
|
58
|
+
custom_variables:
|
|
59
|
+
role: <Server SSH port>
|
|
60
|
+
container:
|
|
61
|
+
host: <Container host>
|
|
62
|
+
ssh_port: <Container ssh port for mapping>
|
|
63
|
+
http_port: <Container http port for mapping>
|
|
64
|
+
|
|
20
65
|
## Usage
|
|
21
66
|
To build an image
|
|
22
67
|
|
|
@@ -42,6 +42,11 @@ module Dockerploy
|
|
|
42
42
|
options[@env][:tagging]
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
+
def image_tag
|
|
46
|
+
raise NoEnvError if @env.nil?
|
|
47
|
+
options[@env][:image_tag]
|
|
48
|
+
end
|
|
49
|
+
|
|
45
50
|
def before_all_hooks
|
|
46
51
|
return {} if options[:hooks].nil? || options[:hooks][:before_deploy].nil?
|
|
47
52
|
options[:hooks][:before_deploy]
|
data/lib/dockerploy/deploy.rb
CHANGED
|
@@ -112,7 +112,8 @@ module Dockerploy
|
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
def image_name
|
|
115
|
-
|
|
115
|
+
tag = @options[:tag] || @config.image_tag
|
|
116
|
+
tag ? sprintf('%s:%s', @config.image_name, tag) : @config.image_name
|
|
116
117
|
end
|
|
117
118
|
end
|
|
118
119
|
end
|
data/lib/dockerploy/version.rb
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
image_name: docker/image
|
|
2
|
+
docker_username: dockeruser
|
|
3
|
+
docker_host: tcp://test.host:4243
|
|
4
|
+
application_name: app
|
|
5
|
+
test:
|
|
6
|
+
branch: test-branch
|
|
7
|
+
image_tag: v1.0.1
|
|
8
|
+
servers:
|
|
9
|
+
- host: server.host
|
|
10
|
+
username: server_user
|
|
11
|
+
password: server_pass
|
|
12
|
+
port: 2000
|
|
13
|
+
role: server_role
|
|
14
|
+
container:
|
|
15
|
+
host: container.host
|
|
16
|
+
ssh_port: 1022
|
|
17
|
+
http_port: 8080
|
|
@@ -143,6 +143,19 @@ docker run -d --name app_8080 --hostname app -p container.host:1022:22 -p contai
|
|
|
143
143
|
subject.deploy
|
|
144
144
|
end
|
|
145
145
|
end
|
|
146
|
+
|
|
147
|
+
context 'with image_tag' do
|
|
148
|
+
let(:fixture_path) { 'spec/fixtures/config_with_image_tag.yml' }
|
|
149
|
+
|
|
150
|
+
it 'creates a container with image tag' do
|
|
151
|
+
expected_command = <<-SHELL
|
|
152
|
+
docker run -d --name app_8080 --hostname app -p container.host:1022:22 -p container.host:8080:80 docker/image:v1.0.1
|
|
153
|
+
SHELL
|
|
154
|
+
expected_command.chomp!
|
|
155
|
+
expect(ssh_client).to receive(:command).with(expected_command).ordered
|
|
156
|
+
subject.deploy
|
|
157
|
+
end
|
|
158
|
+
end
|
|
146
159
|
end
|
|
147
160
|
end
|
|
148
161
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dockerploy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sunjin Lee
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-
|
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -144,6 +144,7 @@ files:
|
|
|
144
144
|
- spec/fixtures/config_with_env_file.yml
|
|
145
145
|
- spec/fixtures/config_with_hooks.yml
|
|
146
146
|
- spec/fixtures/config_with_hooks_for_each_env.yml
|
|
147
|
+
- spec/fixtures/config_with_image_tag.yml
|
|
147
148
|
- spec/fixtures/config_with_tagging.yml
|
|
148
149
|
- spec/fixtures/config_with_volumes.yml
|
|
149
150
|
- spec/fixtures/test.yml
|
|
@@ -182,6 +183,7 @@ test_files:
|
|
|
182
183
|
- spec/fixtures/config_with_env_file.yml
|
|
183
184
|
- spec/fixtures/config_with_hooks.yml
|
|
184
185
|
- spec/fixtures/config_with_hooks_for_each_env.yml
|
|
186
|
+
- spec/fixtures/config_with_image_tag.yml
|
|
185
187
|
- spec/fixtures/config_with_tagging.yml
|
|
186
188
|
- spec/fixtures/config_with_volumes.yml
|
|
187
189
|
- spec/fixtures/test.yml
|