hako 0.17.2 → 0.18.0
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/examples/hello-autoscaling.yml +1 -1
- data/examples/hello-lb.yml +1 -1
- data/examples/hello.yml +2 -2
- data/lib/hako/app_container.rb +0 -5
- data/lib/hako/scripts/nginx_front.rb +10 -12
- data/lib/hako/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a30c23443a235e245cf7581ac2e8370958e52431
|
4
|
+
data.tar.gz: ec03c2205e76f980d0067273ffc7b7cd7a8889d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ceaa7c3d218036910d962f867a6a1236ea821db4dca6a732504188638165394891e56b9098fec28cbe93d5a9c368f97d7244011004912d6919aa06dd49347c0f
|
7
|
+
data.tar.gz: ed0e28623c75f4bc09a9bb99c70faf52e1d63f6ed10c9cd8a9ee1ce7303955db329dbb3230ae35bff3d3ef2549e688637c5bb30ad771502e6aa64128eda0f54b
|
@@ -36,7 +36,6 @@ app:
|
|
36
36
|
image: ryotarai/hello-sinatra
|
37
37
|
memory: 128
|
38
38
|
cpu: 256
|
39
|
-
port: 3000
|
40
39
|
env:
|
41
40
|
$providers:
|
42
41
|
- type: file
|
@@ -50,6 +49,7 @@ additional_containers:
|
|
50
49
|
cpu: 32
|
51
50
|
scripts:
|
52
51
|
- <<: !include front.yml
|
52
|
+
backend_port: 3000
|
53
53
|
locations:
|
54
54
|
/:
|
55
55
|
allow_only_from:
|
data/examples/hello-lb.yml
CHANGED
@@ -17,7 +17,6 @@ app:
|
|
17
17
|
image: ryotarai/hello-sinatra
|
18
18
|
memory: 128
|
19
19
|
cpu: 256
|
20
|
-
port: 3000
|
21
20
|
env:
|
22
21
|
$providers:
|
23
22
|
- type: file
|
@@ -31,6 +30,7 @@ additional_containers:
|
|
31
30
|
cpu: 32
|
32
31
|
scripts:
|
33
32
|
- <<: !include front.yml
|
33
|
+
backend_port: 3000
|
34
34
|
locations:
|
35
35
|
/:
|
36
36
|
allow_only_from:
|
data/examples/hello.yml
CHANGED
@@ -8,7 +8,6 @@ app:
|
|
8
8
|
image: ryotarai/hello-sinatra
|
9
9
|
memory: 128
|
10
10
|
cpu: 256
|
11
|
-
port: 3000
|
12
11
|
links:
|
13
12
|
- redis:redis
|
14
13
|
env:
|
@@ -27,4 +26,5 @@ additional_containers:
|
|
27
26
|
cpu: 64
|
28
27
|
memory: 512
|
29
28
|
scripts:
|
30
|
-
- !include front.yml
|
29
|
+
- <<: !include front.yml
|
30
|
+
backend_port: 3000
|
data/lib/hako/app_container.rb
CHANGED
@@ -40,11 +40,10 @@ module Hako
|
|
40
40
|
# @param [Fixnum] front_port
|
41
41
|
# @return [nil]
|
42
42
|
def deploy_started(containers, front_port)
|
43
|
-
app = containers.fetch('app')
|
44
43
|
front = containers.fetch('front')
|
45
44
|
front.definition['port_mappings'] << port_mapping(front_port)
|
46
|
-
upload_config(generate_config
|
47
|
-
Hako.logger.
|
45
|
+
upload_config(generate_config)
|
46
|
+
Hako.logger.info "Uploaded front configuration to s3://#{@s3.bucket}/#{@s3.key(@app.id)}"
|
48
47
|
end
|
49
48
|
|
50
49
|
private
|
@@ -55,12 +54,13 @@ module Hako
|
|
55
54
|
super
|
56
55
|
@options = options
|
57
56
|
@options['locations'] ||= { '/' => {} }
|
58
|
-
@
|
57
|
+
@backend = options.fetch('backend', 'app')
|
58
|
+
@s3 = S3Config.new(options.fetch('s3'))
|
59
59
|
end
|
60
60
|
|
61
61
|
# @return [String]
|
62
62
|
def link_app
|
63
|
-
|
63
|
+
"#{@backend}:backend"
|
64
64
|
end
|
65
65
|
|
66
66
|
# @param [Fixnum] front_port
|
@@ -69,10 +69,9 @@ module Hako
|
|
69
69
|
{ container_port: 80, host_port: front_port, protocol: 'tcp' }
|
70
70
|
end
|
71
71
|
|
72
|
-
# @param [Fixnum] app_port
|
73
72
|
# @return [String]
|
74
|
-
def generate_config
|
75
|
-
Generator.new(@options
|
73
|
+
def generate_config
|
74
|
+
Generator.new(@options).render
|
76
75
|
end
|
77
76
|
|
78
77
|
# @return [Hash]
|
@@ -95,10 +94,9 @@ module Hako
|
|
95
94
|
|
96
95
|
class Generator
|
97
96
|
# @param [Hash] options
|
98
|
-
|
99
|
-
def initialize(options, app_port)
|
97
|
+
def initialize(options)
|
100
98
|
@options = options
|
101
|
-
@
|
99
|
+
@backend_port = options.fetch('backend_port')
|
102
100
|
end
|
103
101
|
|
104
102
|
# @return [String]
|
@@ -110,7 +108,7 @@ module Hako
|
|
110
108
|
|
111
109
|
# @return [String]
|
112
110
|
def listen_spec
|
113
|
-
"
|
111
|
+
"backend:#{@backend_port}"
|
114
112
|
end
|
115
113
|
|
116
114
|
# @return [String]
|
data/lib/hako/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hako
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kohei Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|
@@ -170,4 +170,3 @@ signing_key:
|
|
170
170
|
specification_version: 4
|
171
171
|
summary: Deploy Docker container
|
172
172
|
test_files: []
|
173
|
-
has_rdoc:
|