fpm-fry 0.4.7 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fpm/fry/command/cook.rb +1 -1
- data/lib/fpm/fry/plugin/service.rb +3 -5
- data/lib/fpm/fry/source/patched.rb +1 -1
- data/lib/fpm/fry/stream_parser.rb +47 -20
- metadata +22 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4911dfb40c91dd585e0ccbbad499a4d71eebadd4c00846b982ed100b186c963f
|
4
|
+
data.tar.gz: 7122bfa7728cb976d3b12010e63be177ccc23d00c360c4830317369f1d1012f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e1ef45f2c7b25b759e3f170b0a3a41d745e686a8a008da43494f6c53166f9695b241f3f2e45dab5fafacfd18a88ae5320e3e7831c4114d5a5e0cbbea08cf10c
|
7
|
+
data.tar.gz: fbe991bb53e481eab8293c0631079af94795f60dc6381635448fac81aaea0b879fe97e50860688654795a820d2813fab581bc06881223514c289bdd70b9dd42f
|
data/lib/fpm/fry/command/cook.rb
CHANGED
@@ -197,7 +197,7 @@ module FPM; module Fry
|
|
197
197
|
)
|
198
198
|
|
199
199
|
client.post(
|
200
|
-
path: client.url('containers',container,'attach?stderr=1&stdout=1&stream=1'),
|
200
|
+
path: client.url('containers',container,'attach?stderr=1&stdout=1&stream=1&logs=1'),
|
201
201
|
body: '',
|
202
202
|
expects: [200],
|
203
203
|
middlewares: [
|
@@ -10,11 +10,9 @@ module FPM::Fry::Plugin ; module Service
|
|
10
10
|
|
11
11
|
def render(file)
|
12
12
|
_erbout = ""
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
17
|
-
eval(erb.src,nil,File.join(File.dirname(__FILE__),'..','templates',file))
|
13
|
+
path = File.join(File.dirname(__FILE__),'..','templates',file)
|
14
|
+
erb = ERB.new(IO.read(path), trim_mode: "-")
|
15
|
+
eval erb.src, nil, path
|
18
16
|
return _erbout
|
19
17
|
end
|
20
18
|
|
@@ -44,7 +44,7 @@ module FPM; module Fry ; module Source
|
|
44
44
|
base = File.expand_path(inner.prefix, base)
|
45
45
|
end
|
46
46
|
package.patches.each do |patch|
|
47
|
-
cmd = ['patch','-
|
47
|
+
cmd = ['patch','-t','-p1','-i',patch[:file]]
|
48
48
|
chdir = base
|
49
49
|
if patch.key? :chdir
|
50
50
|
given_chdir = File.expand_path(patch[:chdir],workdir)
|
@@ -16,38 +16,56 @@ module FPM; module Fry
|
|
16
16
|
if datum[:response]
|
17
17
|
# probably mocked
|
18
18
|
if datum[:response][:body]
|
19
|
-
|
19
|
+
headers = datum[:response][:headers]
|
20
|
+
fake_socket = StringIO.new(datum[:response][:body])
|
21
|
+
parse_response_data(fake_socket, headers)
|
20
22
|
end
|
21
|
-
return @stack.response_call(datum)
|
22
23
|
else
|
23
|
-
socket = datum
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
}
|
36
|
-
|
24
|
+
socket, headers = extract_socket_and_headers(datum)
|
25
|
+
parse_response_data(socket, headers)
|
26
|
+
end
|
27
|
+
@stack.response_call(datum)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def extract_socket_and_headers(datum)
|
33
|
+
socket = datum[:connection].send(:socket)
|
34
|
+
begin
|
35
|
+
line = socket.readline
|
36
|
+
match = /^HTTP\/\d+\.\d+\s(\d{3})\s/.match(line)
|
37
|
+
end while !match
|
38
|
+
status = match[1].to_i
|
39
|
+
|
40
|
+
headers = Excon::Headers.new
|
41
|
+
datum[:response] = {
|
42
|
+
:body => '',
|
43
|
+
:headers => headers,
|
44
|
+
:status => status,
|
45
|
+
:remote_ip => socket.respond_to?(:remote_ip) && socket.remote_ip,
|
46
|
+
}
|
47
|
+
Excon::Response.parse_headers(socket, datum)
|
48
|
+
|
49
|
+
[socket, headers]
|
50
|
+
end
|
37
51
|
|
52
|
+
def parse_response_data(socket, headers)
|
53
|
+
if headers["Transfer-Encoding"] == "chunked"
|
54
|
+
@parser.parse_chunked(socket)
|
55
|
+
else
|
38
56
|
@parser.parse(socket)
|
39
|
-
return @stack.response_call(datum)
|
40
57
|
end
|
41
58
|
end
|
42
59
|
|
43
60
|
end
|
44
61
|
|
45
|
-
attr :out, :err
|
62
|
+
attr :out, :err, :streams
|
46
63
|
|
47
64
|
def initialize(out, err)
|
48
65
|
@out, @err = out, err
|
49
66
|
@state = :null
|
50
67
|
@left = 0
|
68
|
+
@streams = { 1 => out, 2 => err }
|
51
69
|
end
|
52
70
|
|
53
71
|
def new(stack)
|
@@ -55,8 +73,6 @@ module FPM; module Fry
|
|
55
73
|
end
|
56
74
|
|
57
75
|
def parse(socket)
|
58
|
-
left = 0
|
59
|
-
streams = {1 => out, 2 => err}
|
60
76
|
loop do
|
61
77
|
type = read_exactly(socket,4){|part|
|
62
78
|
if part.bytesize == 0
|
@@ -94,5 +110,16 @@ module FPM; module Fry
|
|
94
110
|
return buf
|
95
111
|
end
|
96
112
|
|
113
|
+
def parse_chunked(socket)
|
114
|
+
loop do
|
115
|
+
line = socket.readline
|
116
|
+
chunk_size = line.chomp.to_i(16)
|
117
|
+
break if chunk_size.zero?
|
118
|
+
chunk = socket.read(chunk_size)
|
119
|
+
parse(StringIO.new(chunk))
|
120
|
+
line = socket.readline
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
97
124
|
end
|
98
125
|
end ; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fpm-fry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maxime Lagresle
|
@@ -9,10 +9,11 @@ authors:
|
|
9
9
|
- Sebastian Brandt
|
10
10
|
- Hannes Georg
|
11
11
|
- Julian Tabel
|
12
|
-
|
12
|
+
- Dennis Konert
|
13
|
+
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
15
|
-
date:
|
16
|
+
date: 2022-07-29 00:00:00.000000000 Z
|
16
17
|
dependencies:
|
17
18
|
- !ruby/object:Gem::Dependency
|
18
19
|
name: excon
|
@@ -34,14 +35,14 @@ dependencies:
|
|
34
35
|
requirements:
|
35
36
|
- - "~>"
|
36
37
|
- !ruby/object:Gem::Version
|
37
|
-
version: '1.
|
38
|
+
version: '1.13'
|
38
39
|
type: :runtime
|
39
40
|
prerelease: false
|
40
41
|
version_requirements: !ruby/object:Gem::Requirement
|
41
42
|
requirements:
|
42
43
|
- - "~>"
|
43
44
|
- !ruby/object:Gem::Version
|
44
|
-
version: '1.
|
45
|
+
version: '1.13'
|
45
46
|
- !ruby/object:Gem::Dependency
|
46
47
|
name: rake
|
47
48
|
requirement: !ruby/object:Gem::Requirement
|
@@ -60,22 +61,22 @@ dependencies:
|
|
60
61
|
name: rspec
|
61
62
|
requirement: !ruby/object:Gem::Requirement
|
62
63
|
requirements:
|
63
|
-
- - ">="
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
version: 3.0.0
|
66
64
|
- - "~>"
|
67
65
|
- !ruby/object:Gem::Version
|
68
66
|
version: '3.0'
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 3.0.0
|
69
70
|
type: :development
|
70
71
|
prerelease: false
|
71
72
|
version_requirements: !ruby/object:Gem::Requirement
|
72
73
|
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 3.0.0
|
76
74
|
- - "~>"
|
77
75
|
- !ruby/object:Gem::Version
|
78
76
|
version: '3.0'
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: 3.0.0
|
79
80
|
- !ruby/object:Gem::Dependency
|
80
81
|
name: webmock
|
81
82
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,32 +95,32 @@ dependencies:
|
|
94
95
|
name: coveralls
|
95
96
|
requirement: !ruby/object:Gem::Requirement
|
96
97
|
requirements:
|
97
|
-
- - "
|
98
|
+
- - ">="
|
98
99
|
- !ruby/object:Gem::Version
|
99
|
-
version:
|
100
|
+
version: 0.8.23
|
100
101
|
type: :development
|
101
102
|
prerelease: false
|
102
103
|
version_requirements: !ruby/object:Gem::Requirement
|
103
104
|
requirements:
|
104
|
-
- - "
|
105
|
+
- - ">="
|
105
106
|
- !ruby/object:Gem::Version
|
106
|
-
version:
|
107
|
+
version: 0.8.23
|
107
108
|
- !ruby/object:Gem::Dependency
|
108
109
|
name: simplecov
|
109
110
|
requirement: !ruby/object:Gem::Requirement
|
110
111
|
requirements:
|
111
|
-
- - "
|
112
|
+
- - ">="
|
112
113
|
- !ruby/object:Gem::Version
|
113
114
|
version: '0'
|
114
115
|
type: :development
|
115
116
|
prerelease: false
|
116
117
|
version_requirements: !ruby/object:Gem::Requirement
|
117
118
|
requirements:
|
118
|
-
- - "
|
119
|
+
- - ">="
|
119
120
|
- !ruby/object:Gem::Version
|
120
121
|
version: '0'
|
121
122
|
description: deep-fried package builder
|
122
|
-
email:
|
123
|
+
email: dennis.konert@new-work.se
|
123
124
|
executables:
|
124
125
|
- fpm-fry
|
125
126
|
extensions: []
|
@@ -181,7 +182,7 @@ homepage: https://github.com/xing/fpm-fry
|
|
181
182
|
licenses:
|
182
183
|
- MIT
|
183
184
|
metadata: {}
|
184
|
-
post_install_message:
|
185
|
+
post_install_message:
|
185
186
|
rdoc_options: []
|
186
187
|
require_paths:
|
187
188
|
- lib
|
@@ -196,8 +197,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
197
|
- !ruby/object:Gem::Version
|
197
198
|
version: '0'
|
198
199
|
requirements: []
|
199
|
-
rubygems_version: 3.
|
200
|
-
signing_key:
|
200
|
+
rubygems_version: 3.3.15
|
201
|
+
signing_key:
|
201
202
|
specification_version: 4
|
202
203
|
summary: FPM Fry
|
203
204
|
test_files: []
|