popito 0.0.3.alpha → 0.0.4.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/popito +1 -1
- data/lib/popito/deployer/build/build_executor.rb +14 -18
- data/lib/popito/deployer/build/builders/docker.rb +16 -13
- data/lib/popito/deployer/version.rb +1 -1
- metadata +3 -4
- data/.byebug_history +0 -256
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54bafeba7b6374adfb205c90127fd7f242fdb44e773071d3a98640dc2eea8d67
|
4
|
+
data.tar.gz: 36153ff1ade6486382c933c983acd8df5f6ef12ceeb175610070cb650fea134b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c926366fbae27378623274a9d6f28a8c769c9dbeddc2fe11fce9ff095f0cb0bc2236aced45ef597cbfde7a9b6209161d25cd5dd8f126bd2708531651d79d62f6
|
7
|
+
data.tar.gz: 1ef977a728676570910a8fcd6cf48c93bba4fe025f74e40da863a12958bdbe42ba3543fcdf477a6da2aaf2d1b3a63f7a69f6c39123330e98b50d53d870f16e45
|
data/exe/popito
CHANGED
@@ -30,7 +30,7 @@ stages.push('deploy') if params[:deploy]
|
|
30
30
|
build_config = JSON.parse(params[:"build-config-json"] || "{}").merge(
|
31
31
|
{
|
32
32
|
IMAGE_TAG: params[:tag],
|
33
|
-
IMAGE_TAG_ALT: params[:
|
33
|
+
IMAGE_TAG_ALT: params[:"tag-alt"],
|
34
34
|
ENVIRONMENT: params[:env]
|
35
35
|
}
|
36
36
|
)
|
@@ -15,29 +15,25 @@ module Popito
|
|
15
15
|
|
16
16
|
def build
|
17
17
|
yaml_config["build"].each do |build|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
builder.build
|
26
|
-
end
|
18
|
+
builder = Popito::BuildExecutor::Builders::Docker.new(
|
19
|
+
root_path: config_payload.project_path,
|
20
|
+
dockerfile: "#{config_payload.build_path}/#{build['dockerfile']}",
|
21
|
+
image: build["image"],
|
22
|
+
tags: build["tags"]
|
23
|
+
)
|
24
|
+
builder.build
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
30
28
|
def release
|
31
29
|
yaml_config["build"].each do |build|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
builder.push
|
40
|
-
end
|
30
|
+
builder = Popito::BuildExecutor::Builders::Docker.new(
|
31
|
+
root_path: config_payload.project_path,
|
32
|
+
dockerfile: "#{config_payload.build_path}/#{build['dockerfile']}",
|
33
|
+
image: build["image"],
|
34
|
+
tags: build["tags"]
|
35
|
+
)
|
36
|
+
builder.push
|
41
37
|
end
|
42
38
|
end
|
43
39
|
|
@@ -3,12 +3,12 @@ module Popito
|
|
3
3
|
class BuildExecutor
|
4
4
|
module Builders
|
5
5
|
class Docker
|
6
|
-
attr_accessor :dockerfile, :image, :
|
6
|
+
attr_accessor :dockerfile, :image, :tags, :root_path
|
7
7
|
|
8
|
-
def initialize(root_path:, dockerfile:, image:,
|
8
|
+
def initialize(root_path:, dockerfile:, image:, tags:)
|
9
9
|
self.dockerfile = dockerfile
|
10
10
|
self.image = image
|
11
|
-
self.
|
11
|
+
self.tags = tags
|
12
12
|
self.root_path = root_path
|
13
13
|
end
|
14
14
|
|
@@ -16,7 +16,7 @@ module Popito
|
|
16
16
|
puts "Building ..."
|
17
17
|
puts "Dockerfile: #{dockerfile}"
|
18
18
|
puts "Image: #{image}"
|
19
|
-
puts "
|
19
|
+
puts "Tags: #{tags}"
|
20
20
|
Dir.chdir(root_path)
|
21
21
|
docker_build
|
22
22
|
end
|
@@ -25,24 +25,27 @@ module Popito
|
|
25
25
|
puts "Pushing ..."
|
26
26
|
puts "Dockerfile: #{dockerfile}"
|
27
27
|
puts "Image: #{image}"
|
28
|
-
puts "
|
28
|
+
puts "Tags: #{tags}"
|
29
29
|
docker_push
|
30
30
|
end
|
31
31
|
|
32
32
|
private
|
33
33
|
|
34
34
|
def docker_push
|
35
|
-
|
36
|
-
|
35
|
+
tags.each do |tag|
|
36
|
+
puts "#{self.class.name}: docker push #{image}:#{tag}"
|
37
|
+
system "docker push #{image}:#{tag}, exception: true"
|
38
|
+
end
|
37
39
|
end
|
38
40
|
|
39
41
|
def docker_build
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
"#{
|
42
|
+
command = "docker build -f #{dockerfile}"
|
43
|
+
tags.each do |tag|
|
44
|
+
command << " --tag #{image}:#{tag}"
|
45
|
+
end
|
46
|
+
command << " ."
|
47
|
+
puts "#{self.class.name}: #{command}"
|
48
|
+
system command, exception: true
|
46
49
|
end
|
47
50
|
end
|
48
51
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popito
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wagner Caixeta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: deep_merge
|
@@ -102,7 +102,6 @@ executables:
|
|
102
102
|
extensions: []
|
103
103
|
extra_rdoc_files: []
|
104
104
|
files:
|
105
|
-
- ".byebug_history"
|
106
105
|
- ".gitignore"
|
107
106
|
- ".gitlab-ci.yml"
|
108
107
|
- ".rubocop.yml"
|
@@ -145,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
144
|
- !ruby/object:Gem::Version
|
146
145
|
version: 1.3.1
|
147
146
|
requirements: []
|
148
|
-
rubygems_version: 3.1
|
147
|
+
rubygems_version: 3.0.3.1
|
149
148
|
signing_key:
|
150
149
|
specification_version: 4
|
151
150
|
summary: 'WIP: Build docker images for Rails Projects and deploy it on K8S using a
|
data/.byebug_history
DELETED
@@ -1,256 +0,0 @@
|
|
1
|
-
q
|
2
|
-
build_config
|
3
|
-
q
|
4
|
-
build_config
|
5
|
-
q
|
6
|
-
build_config = JSON.parse(params[:"build-config-json"] || "{}").merge(
|
7
|
-
{
|
8
|
-
IMAGE_TAG: params[:tag],
|
9
|
-
IMAGE_TAG_ALT: params[:tag_alt],
|
10
|
-
ENVIRONMENT: params[:env]
|
11
|
-
}
|
12
|
-
)
|
13
|
-
params[:"build-config-json"]
|
14
|
-
params
|
15
|
-
params[:build_config_json]
|
16
|
-
params[:build_config]params[:build_config_json]
|
17
|
-
q
|
18
|
-
build_config
|
19
|
-
config_payload
|
20
|
-
c
|
21
|
-
build_config
|
22
|
-
q
|
23
|
-
params
|
24
|
-
q
|
25
|
-
params
|
26
|
-
q
|
27
|
-
params
|
28
|
-
q
|
29
|
-
params
|
30
|
-
q
|
31
|
-
params[:token]
|
32
|
-
params
|
33
|
-
q
|
34
|
-
params
|
35
|
-
c
|
36
|
-
JSON.parse(err.response.body)["message"]
|
37
|
-
err
|
38
|
-
q
|
39
|
-
err
|
40
|
-
q
|
41
|
-
n
|
42
|
-
y
|
43
|
-
q
|
44
|
-
err.response.body
|
45
|
-
err
|
46
|
-
q
|
47
|
-
puts caller()
|
48
|
-
caller()
|
49
|
-
call()
|
50
|
-
call
|
51
|
-
err
|
52
|
-
err.class
|
53
|
-
err
|
54
|
-
err.response
|
55
|
-
JSON.parse(err.response.body)
|
56
|
-
JSON.parse(err.response.body)["message"]
|
57
|
-
err
|
58
|
-
c
|
59
|
-
JSON.parse(response.body).class
|
60
|
-
JSON.parse(response.body)
|
61
|
-
response.body
|
62
|
-
n
|
63
|
-
q
|
64
|
-
default_headers
|
65
|
-
q
|
66
|
-
headers
|
67
|
-
q
|
68
|
-
config_payload
|
69
|
-
continue
|
70
|
-
x["build"][0]["dockerfile"]
|
71
|
-
x["build"][0]["targets"]
|
72
|
-
x["build"][0]
|
73
|
-
x["build"]
|
74
|
-
x=YAML.load(File.read("#{config_payload.build_path}/build.yaml"))
|
75
|
-
x["build"]
|
76
|
-
x=YAML.load(File.read("#{config_payload.build_path}/build.yaml")).class
|
77
|
-
x
|
78
|
-
x["build"]
|
79
|
-
x=YAML.load(File.read("#{config_payload.build_path}/build.yaml")).class
|
80
|
-
x[0]
|
81
|
-
x=YAML.load(File.read("#{config_payload.build_path}/build.yaml")).class
|
82
|
-
YAML.load(File.read("#{config_payload.build_path}/build.yaml")).class
|
83
|
-
YAML.load(File.read("#{config_payload.build_path}/build.yaml"))
|
84
|
-
q
|
85
|
-
YAML.load(File.read("#{config_payload.project_path}/build.yaml"))
|
86
|
-
c
|
87
|
-
continue
|
88
|
-
z.read
|
89
|
-
x.read
|
90
|
-
z = Zlib::GzipReader.new(StringIO.new(body))
|
91
|
-
body
|
92
|
-
z = Zlib::GzipReader.new(body)
|
93
|
-
z = Zlib::GzipReader.new(body)
|
94
|
-
unzipped = StringIO.new(z.read)
|
95
|
-
body
|
96
|
-
c
|
97
|
-
q
|
98
|
-
body
|
99
|
-
c
|
100
|
-
q
|
101
|
-
body.size
|
102
|
-
body
|
103
|
-
c
|
104
|
-
q
|
105
|
-
JSON.parse(err.response.body)["code"]
|
106
|
-
JSON.parse(err.response.body)
|
107
|
-
JSON.parse(err.response.body)["codigo"]
|
108
|
-
JSON.parse(err.response.body)["codigo"] + ""
|
109
|
-
JSON.parse(err.response.body)["code"] + ""
|
110
|
-
JSON.parse(err.response.body)["message"]
|
111
|
-
TypeError.kind_of?(RuntimeError)
|
112
|
-
JSON.parse('{}')
|
113
|
-
JSON.parse({})
|
114
|
-
JSON.parse("")
|
115
|
-
JSON.parse(nil)
|
116
|
-
JSON.parse(err.response.body)["message"]
|
117
|
-
JSON.parse(err.response.body)
|
118
|
-
::JSON.parse(err.response.body)
|
119
|
-
require 'json'
|
120
|
-
::JSON.parse(err.response.body)
|
121
|
-
JSON.parse(err.response.body)
|
122
|
-
JSON(err.response.body)
|
123
|
-
err.response.body
|
124
|
-
err.response
|
125
|
-
c
|
126
|
-
q
|
127
|
-
response
|
128
|
-
c
|
129
|
-
q
|
130
|
-
ARGV[0]
|
131
|
-
ARGV[1]
|
132
|
-
continue
|
133
|
-
y
|
134
|
-
q
|
135
|
-
config_payload.project_path
|
136
|
-
File.expand_path(config_payload.project_path)
|
137
|
-
q
|
138
|
-
config_payload.project_path
|
139
|
-
config_payload
|
140
|
-
q
|
141
|
-
c
|
142
|
-
q
|
143
|
-
current_scope&.config.nil?
|
144
|
-
context
|
145
|
-
current_scope
|
146
|
-
q
|
147
|
-
default
|
148
|
-
context.config
|
149
|
-
context
|
150
|
-
current_scope
|
151
|
-
c
|
152
|
-
q
|
153
|
-
config_payload.get_value(key: 'RAILS_RUN_MIGRATES', default: 'false')
|
154
|
-
q
|
155
|
-
config_payload.get_value(key: 'ENVIRONMENT')
|
156
|
-
config_payload.get_value(key: :ENVIRONMENT)
|
157
|
-
config_payload.get_value(:ENVIRONMENTconfig_payload.get_value(key: :ENVIRONMENT))
|
158
|
-
config_payload.get_value(:ENVIRONMENT)
|
159
|
-
q
|
160
|
-
container[:env]
|
161
|
-
c
|
162
|
-
container[:env]
|
163
|
-
c
|
164
|
-
container[:env]
|
165
|
-
c
|
166
|
-
container[:env]
|
167
|
-
c
|
168
|
-
container[:env]
|
169
|
-
c
|
170
|
-
container[:env]
|
171
|
-
c
|
172
|
-
container[:env]
|
173
|
-
c
|
174
|
-
container[:env]
|
175
|
-
q
|
176
|
-
continue
|
177
|
-
q
|
178
|
-
container[:env]
|
179
|
-
c
|
180
|
-
container[:env]
|
181
|
-
byebug
|
182
|
-
q
|
183
|
-
container[:env]
|
184
|
-
c
|
185
|
-
container[:env]
|
186
|
-
c
|
187
|
-
container[:env]
|
188
|
-
c
|
189
|
-
container[:env]
|
190
|
-
q
|
191
|
-
continue
|
192
|
-
config_payload.context.config.ENV
|
193
|
-
config_payload.context.config.env
|
194
|
-
config_payload.context.config
|
195
|
-
container[:env][0]config_payload.context.config
|
196
|
-
container[:env]
|
197
|
-
c
|
198
|
-
container[:env]
|
199
|
-
c
|
200
|
-
container[:env]
|
201
|
-
c
|
202
|
-
container[:env]
|
203
|
-
container[:name]
|
204
|
-
container
|
205
|
-
config_payload.current_scope.config
|
206
|
-
q
|
207
|
-
config_payload.current_scope.config
|
208
|
-
config_payload.current_scope.name
|
209
|
-
config_payload.current_scope
|
210
|
-
c
|
211
|
-
config_payload.current_scope.config
|
212
|
-
c
|
213
|
-
config_payload.current_scope.config
|
214
|
-
c
|
215
|
-
config_payload.current_scope.config
|
216
|
-
c
|
217
|
-
config_payload.current_scope.config
|
218
|
-
c
|
219
|
-
config_payload.current_scope.config
|
220
|
-
c
|
221
|
-
config_payload.current_scope.config
|
222
|
-
c
|
223
|
-
config_payload.current_scope.config
|
224
|
-
c
|
225
|
-
config_payload.current_scope.config
|
226
|
-
c
|
227
|
-
config_payload.current_scope.config
|
228
|
-
q
|
229
|
-
config_payload.current_scope.config
|
230
|
-
current_context
|
231
|
-
current_scope
|
232
|
-
config_payload
|
233
|
-
container
|
234
|
-
container["type"]
|
235
|
-
container[:type]
|
236
|
-
c
|
237
|
-
container[:type]
|
238
|
-
container["config"]
|
239
|
-
c
|
240
|
-
container["config"]
|
241
|
-
c
|
242
|
-
container["config"]
|
243
|
-
c
|
244
|
-
container["config"]
|
245
|
-
c
|
246
|
-
container["config"]
|
247
|
-
c
|
248
|
-
container["config"]
|
249
|
-
q
|
250
|
-
container["config"]
|
251
|
-
c
|
252
|
-
container["config"]
|
253
|
-
c
|
254
|
-
container["config"]
|
255
|
-
c
|
256
|
-
container["config"]
|