litterbox 0.1.0 → 0.1.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 +4 -4
- data/.gitignore +2 -3
- data/.rubocop.yml +8 -1
- data/.travis.yml +7 -1
- data/Gemfile.lock +3 -1
- data/README.md +7 -1
- data/Rakefile +6 -0
- data/bin/litterbox +1 -1
- data/docs/Litterbox/CLI.html +354 -0
- data/docs/Litterbox/Command.html +520 -0
- data/docs/Litterbox/Habitat/Build.html +280 -0
- data/docs/Litterbox/Habitat/Export.html +286 -0
- data/docs/Litterbox/Habitat/Package.html +570 -0
- data/docs/Litterbox/Habitat/Promote.html +288 -0
- data/docs/Litterbox/Habitat/Upload.html +292 -0
- data/docs/Litterbox/Habitat.html +128 -0
- data/docs/Litterbox/LastBuild.html +781 -0
- data/docs/Litterbox.html +225 -0
- data/docs/_index.html +218 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +499 -0
- data/docs/file.README.html +159 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +159 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +315 -0
- data/docs/top-level-namespace.html +110 -0
- data/exe/litterbox +5 -0
- data/lib/litterbox/command.rb +38 -0
- data/lib/litterbox/habitat/package.rb +47 -0
- data/lib/litterbox/habitat/upload.rb +4 -1
- data/lib/litterbox/habitat.rb +1 -0
- data/lib/litterbox/version.rb +1 -1
- data/lib/litterbox.rb +8 -8
- data/litterbox.gemspec +1 -0
- metadata +43 -2
@@ -0,0 +1,315 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<meta charset="utf-8" />
|
6
|
+
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
|
8
|
+
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
14
|
+
|
15
|
+
<script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
|
16
|
+
|
17
|
+
|
18
|
+
<title>Method List</title>
|
19
|
+
<base id="base_target" target="_parent" />
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div id="content">
|
23
|
+
<div class="fixed_header">
|
24
|
+
<h1 id="full_list_header">Method List</h1>
|
25
|
+
<div id="full_list_nav">
|
26
|
+
|
27
|
+
<span><a target="_self" href="class_list.html">
|
28
|
+
Classes
|
29
|
+
</a></span>
|
30
|
+
|
31
|
+
<span><a target="_self" href="method_list.html">
|
32
|
+
Methods
|
33
|
+
</a></span>
|
34
|
+
|
35
|
+
<span><a target="_self" href="file_list.html">
|
36
|
+
Files
|
37
|
+
</a></span>
|
38
|
+
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div id="search">Search: <input type="text" /></div>
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<ul id="full_list" class="method">
|
45
|
+
|
46
|
+
|
47
|
+
<li class="odd ">
|
48
|
+
<div class="item">
|
49
|
+
<span class='object_link'><a href="Litterbox/CLI.html#build-instance_method" title="Litterbox::CLI#build (method)">#build</a></span>
|
50
|
+
<small>Litterbox::CLI</small>
|
51
|
+
</div>
|
52
|
+
</li>
|
53
|
+
|
54
|
+
|
55
|
+
<li class="even ">
|
56
|
+
<div class="item">
|
57
|
+
<span class='object_link'><a href="Litterbox/Habitat/Build.html#build-instance_method" title="Litterbox::Habitat::Build#build (method)">#build</a></span>
|
58
|
+
<small>Litterbox::Habitat::Build</small>
|
59
|
+
</div>
|
60
|
+
</li>
|
61
|
+
|
62
|
+
|
63
|
+
<li class="odd ">
|
64
|
+
<div class="item">
|
65
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#demote-instance_method" title="Litterbox::Habitat::Package#demote (method)">#demote</a></span>
|
66
|
+
<small>Litterbox::Habitat::Package</small>
|
67
|
+
</div>
|
68
|
+
</li>
|
69
|
+
|
70
|
+
|
71
|
+
<li class="even ">
|
72
|
+
<div class="item">
|
73
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#exec-instance_method" title="Litterbox::Habitat::Package#exec (method)">#exec</a></span>
|
74
|
+
<small>Litterbox::Habitat::Package</small>
|
75
|
+
</div>
|
76
|
+
</li>
|
77
|
+
|
78
|
+
|
79
|
+
<li class="odd ">
|
80
|
+
<div class="item">
|
81
|
+
<span class='object_link'><a href="Litterbox/CLI.html#export-instance_method" title="Litterbox::CLI#export (method)">#export</a></span>
|
82
|
+
<small>Litterbox::CLI</small>
|
83
|
+
</div>
|
84
|
+
</li>
|
85
|
+
|
86
|
+
|
87
|
+
<li class="even ">
|
88
|
+
<div class="item">
|
89
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#initialize-instance_method" title="Litterbox::Habitat::Package#initialize (method)">#initialize</a></span>
|
90
|
+
<small>Litterbox::Habitat::Package</small>
|
91
|
+
</div>
|
92
|
+
</li>
|
93
|
+
|
94
|
+
|
95
|
+
<li class="odd ">
|
96
|
+
<div class="item">
|
97
|
+
<span class='object_link'><a href="Litterbox/Habitat/Promote.html#initialize-instance_method" title="Litterbox::Habitat::Promote#initialize (method)">#initialize</a></span>
|
98
|
+
<small>Litterbox::Habitat::Promote</small>
|
99
|
+
</div>
|
100
|
+
</li>
|
101
|
+
|
102
|
+
|
103
|
+
<li class="even ">
|
104
|
+
<div class="item">
|
105
|
+
<span class='object_link'><a href="Litterbox/Command.html#initialize-instance_method" title="Litterbox::Command#initialize (method)">#initialize</a></span>
|
106
|
+
<small>Litterbox::Command</small>
|
107
|
+
</div>
|
108
|
+
</li>
|
109
|
+
|
110
|
+
|
111
|
+
<li class="odd ">
|
112
|
+
<div class="item">
|
113
|
+
<span class='object_link'><a href="Litterbox/Habitat/Upload.html#initialize-instance_method" title="Litterbox::Habitat::Upload#initialize (method)">#initialize</a></span>
|
114
|
+
<small>Litterbox::Habitat::Upload</small>
|
115
|
+
</div>
|
116
|
+
</li>
|
117
|
+
|
118
|
+
|
119
|
+
<li class="even ">
|
120
|
+
<div class="item">
|
121
|
+
<span class='object_link'><a href="Litterbox/Habitat/Export.html#initialize-instance_method" title="Litterbox::Habitat::Export#initialize (method)">#initialize</a></span>
|
122
|
+
<small>Litterbox::Habitat::Export</small>
|
123
|
+
</div>
|
124
|
+
</li>
|
125
|
+
|
126
|
+
|
127
|
+
<li class="odd ">
|
128
|
+
<div class="item">
|
129
|
+
<span class='object_link'><a href="Litterbox/Habitat/Build.html#initialize-instance_method" title="Litterbox::Habitat::Build#initialize (method)">#initialize</a></span>
|
130
|
+
<small>Litterbox::Habitat::Build</small>
|
131
|
+
</div>
|
132
|
+
</li>
|
133
|
+
|
134
|
+
|
135
|
+
<li class="even ">
|
136
|
+
<div class="item">
|
137
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#install-instance_method" title="Litterbox::Habitat::Package#install (method)">#install</a></span>
|
138
|
+
<small>Litterbox::Habitat::Package</small>
|
139
|
+
</div>
|
140
|
+
</li>
|
141
|
+
|
142
|
+
|
143
|
+
<li class="odd ">
|
144
|
+
<div class="item">
|
145
|
+
<span class='object_link'><a href="Litterbox.html#last_build-class_method" title="Litterbox.last_build (method)">last_build</a></span>
|
146
|
+
<small>Litterbox</small>
|
147
|
+
</div>
|
148
|
+
</li>
|
149
|
+
|
150
|
+
|
151
|
+
<li class="even ">
|
152
|
+
<div class="item">
|
153
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#name-instance_method" title="Litterbox::Habitat::Package#name (method)">#name</a></span>
|
154
|
+
<small>Litterbox::Habitat::Package</small>
|
155
|
+
</div>
|
156
|
+
</li>
|
157
|
+
|
158
|
+
|
159
|
+
<li class="odd ">
|
160
|
+
<div class="item">
|
161
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#parse-class_method" title="Litterbox::LastBuild.parse (method)">parse</a></span>
|
162
|
+
<small>Litterbox::LastBuild</small>
|
163
|
+
</div>
|
164
|
+
</li>
|
165
|
+
|
166
|
+
|
167
|
+
<li class="even ">
|
168
|
+
<div class="item">
|
169
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_artifact-instance_method" title="Litterbox::LastBuild#pkg_artifact (method)">#pkg_artifact</a></span>
|
170
|
+
<small>Litterbox::LastBuild</small>
|
171
|
+
</div>
|
172
|
+
</li>
|
173
|
+
|
174
|
+
|
175
|
+
<li class="odd ">
|
176
|
+
<div class="item">
|
177
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_blake2bsum-instance_method" title="Litterbox::LastBuild#pkg_blake2bsum (method)">#pkg_blake2bsum</a></span>
|
178
|
+
<small>Litterbox::LastBuild</small>
|
179
|
+
</div>
|
180
|
+
</li>
|
181
|
+
|
182
|
+
|
183
|
+
<li class="even ">
|
184
|
+
<div class="item">
|
185
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_ident-instance_method" title="Litterbox::LastBuild#pkg_ident (method)">#pkg_ident</a></span>
|
186
|
+
<small>Litterbox::LastBuild</small>
|
187
|
+
</div>
|
188
|
+
</li>
|
189
|
+
|
190
|
+
|
191
|
+
<li class="odd ">
|
192
|
+
<div class="item">
|
193
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_name-instance_method" title="Litterbox::LastBuild#pkg_name (method)">#pkg_name</a></span>
|
194
|
+
<small>Litterbox::LastBuild</small>
|
195
|
+
</div>
|
196
|
+
</li>
|
197
|
+
|
198
|
+
|
199
|
+
<li class="even ">
|
200
|
+
<div class="item">
|
201
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_origin-instance_method" title="Litterbox::LastBuild#pkg_origin (method)">#pkg_origin</a></span>
|
202
|
+
<small>Litterbox::LastBuild</small>
|
203
|
+
</div>
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
<li class="odd ">
|
208
|
+
<div class="item">
|
209
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_release-instance_method" title="Litterbox::LastBuild#pkg_release (method)">#pkg_release</a></span>
|
210
|
+
<small>Litterbox::LastBuild</small>
|
211
|
+
</div>
|
212
|
+
</li>
|
213
|
+
|
214
|
+
|
215
|
+
<li class="even ">
|
216
|
+
<div class="item">
|
217
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_sha256sum-instance_method" title="Litterbox::LastBuild#pkg_sha256sum (method)">#pkg_sha256sum</a></span>
|
218
|
+
<small>Litterbox::LastBuild</small>
|
219
|
+
</div>
|
220
|
+
</li>
|
221
|
+
|
222
|
+
|
223
|
+
<li class="odd ">
|
224
|
+
<div class="item">
|
225
|
+
<span class='object_link'><a href="Litterbox/LastBuild.html#pkg_version-instance_method" title="Litterbox::LastBuild#pkg_version (method)">#pkg_version</a></span>
|
226
|
+
<small>Litterbox::LastBuild</small>
|
227
|
+
</div>
|
228
|
+
</li>
|
229
|
+
|
230
|
+
|
231
|
+
<li class="even ">
|
232
|
+
<div class="item">
|
233
|
+
<span class='object_link'><a href="Litterbox/Command.html#process-instance_method" title="Litterbox::Command#process (method)">#process</a></span>
|
234
|
+
<small>Litterbox::Command</small>
|
235
|
+
</div>
|
236
|
+
</li>
|
237
|
+
|
238
|
+
|
239
|
+
<li class="odd ">
|
240
|
+
<div class="item">
|
241
|
+
<span class='object_link'><a href="Litterbox/Habitat/Promote.html#promote-instance_method" title="Litterbox::Habitat::Promote#promote (method)">#promote</a></span>
|
242
|
+
<small>Litterbox::Habitat::Promote</small>
|
243
|
+
</div>
|
244
|
+
</li>
|
245
|
+
|
246
|
+
|
247
|
+
<li class="even ">
|
248
|
+
<div class="item">
|
249
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#promote-instance_method" title="Litterbox::Habitat::Package#promote (method)">#promote</a></span>
|
250
|
+
<small>Litterbox::Habitat::Package</small>
|
251
|
+
</div>
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="odd ">
|
256
|
+
<div class="item">
|
257
|
+
<span class='object_link'><a href="Litterbox/Command.html#run_command-instance_method" title="Litterbox::Command#run_command (method)">#run_command</a></span>
|
258
|
+
<small>Litterbox::Command</small>
|
259
|
+
</div>
|
260
|
+
</li>
|
261
|
+
|
262
|
+
|
263
|
+
<li class="even ">
|
264
|
+
<div class="item">
|
265
|
+
<span class='object_link'><a href="Litterbox/Command.html#stderr-instance_method" title="Litterbox::Command#stderr (method)">#stderr</a></span>
|
266
|
+
<small>Litterbox::Command</small>
|
267
|
+
</div>
|
268
|
+
</li>
|
269
|
+
|
270
|
+
|
271
|
+
<li class="odd ">
|
272
|
+
<div class="item">
|
273
|
+
<span class='object_link'><a href="Litterbox/Command.html#stdout-instance_method" title="Litterbox::Command#stdout (method)">#stdout</a></span>
|
274
|
+
<small>Litterbox::Command</small>
|
275
|
+
</div>
|
276
|
+
</li>
|
277
|
+
|
278
|
+
|
279
|
+
<li class="even ">
|
280
|
+
<div class="item">
|
281
|
+
<span class='object_link'><a href="Litterbox/Habitat/Upload.html#upload-instance_method" title="Litterbox::Habitat::Upload#upload (method)">#upload</a></span>
|
282
|
+
<small>Litterbox::Habitat::Upload</small>
|
283
|
+
</div>
|
284
|
+
</li>
|
285
|
+
|
286
|
+
|
287
|
+
<li class="odd ">
|
288
|
+
<div class="item">
|
289
|
+
<span class='object_link'><a href="Litterbox/Habitat/Package.html#upload-instance_method" title="Litterbox::Habitat::Package#upload (method)">#upload</a></span>
|
290
|
+
<small>Litterbox::Habitat::Package</small>
|
291
|
+
</div>
|
292
|
+
</li>
|
293
|
+
|
294
|
+
|
295
|
+
<li class="even ">
|
296
|
+
<div class="item">
|
297
|
+
<span class='object_link'><a href="Litterbox/Habitat/Export.html#upload-instance_method" title="Litterbox::Habitat::Export#upload (method)">#upload</a></span>
|
298
|
+
<small>Litterbox::Habitat::Export</small>
|
299
|
+
</div>
|
300
|
+
</li>
|
301
|
+
|
302
|
+
|
303
|
+
<li class="odd ">
|
304
|
+
<div class="item">
|
305
|
+
<span class='object_link'><a href="Litterbox/CLI.html#upload-instance_method" title="Litterbox::CLI#upload (method)">#upload</a></span>
|
306
|
+
<small>Litterbox::CLI</small>
|
307
|
+
</div>
|
308
|
+
</li>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
</ul>
|
313
|
+
</div>
|
314
|
+
</body>
|
315
|
+
</html>
|
@@ -0,0 +1,110 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Top Level Namespace
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.12
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">Top Level Namespace</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Top Level Namespace
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<h2>Defined Under Namespace</h2>
|
82
|
+
<p class="children">
|
83
|
+
|
84
|
+
|
85
|
+
<strong class="modules">Modules:</strong> <span class='object_link'><a href="Litterbox.html" title="Litterbox (module)">Litterbox</a></span>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
</p>
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<div id="footer">
|
103
|
+
Generated on Wed May 2 10:27:51 2018 by
|
104
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
105
|
+
0.9.12 (ruby-2.5.0).
|
106
|
+
</div>
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</body>
|
110
|
+
</html>
|
data/exe/litterbox
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Litterbox
|
2
|
+
# CLI Command operations
|
3
|
+
class Command
|
4
|
+
attr_accessor :stdout, :stderr, :process
|
5
|
+
def initialize(cmd, log = ENV['LITTERBOX_LOG'])
|
6
|
+
@cmd = cmd
|
7
|
+
@cmd = "sudo #{@cmd}" if ENV['USE_SUDO']
|
8
|
+
@stdout = ''
|
9
|
+
@stderr = ''
|
10
|
+
@log = log
|
11
|
+
end
|
12
|
+
|
13
|
+
def run_command
|
14
|
+
Open3.popen3(@cmd) do |_, out, err, thr|
|
15
|
+
capture_stderr err
|
16
|
+
capture_stdout out
|
17
|
+
@process = thr.value
|
18
|
+
return @stdout, @stderr, @process
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def capture_stderr(err)
|
25
|
+
while (line = err.gets)
|
26
|
+
@stderr << line unless line.nil?
|
27
|
+
puts(line) if @log
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def capture_stdout(out)
|
32
|
+
while (lines = out.gets)
|
33
|
+
@stdout << lines unless lines.nil?
|
34
|
+
puts(lines) if @log
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Litterbox
|
2
|
+
module Habitat
|
3
|
+
# Habitat package operations
|
4
|
+
class Package
|
5
|
+
attr_accessor :name
|
6
|
+
|
7
|
+
def initialize(name)
|
8
|
+
@name = name
|
9
|
+
end
|
10
|
+
|
11
|
+
def install(name = @name)
|
12
|
+
exec_cmd "hab pkg install #{name}"
|
13
|
+
end
|
14
|
+
|
15
|
+
def exec(command)
|
16
|
+
install
|
17
|
+
exec_cmd "hab pkg exec #{@name} #{command}"
|
18
|
+
end
|
19
|
+
|
20
|
+
def upload(pkg, auth)
|
21
|
+
Litterbox::Habitat::Upload.new(
|
22
|
+
pkg, auth
|
23
|
+
).upload
|
24
|
+
end
|
25
|
+
|
26
|
+
def promote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN'])
|
27
|
+
Litterbox::Habitat::Promote.new(
|
28
|
+
pkg_ident, channel, auth
|
29
|
+
).promote
|
30
|
+
end
|
31
|
+
|
32
|
+
def demote(pkg_ident, channel, auth = ENV['HAB_AUTH_TOKEN'])
|
33
|
+
exec_cmd "hab pkg demote #{pkg_ident} #{channel} -z #{auth}"
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def exec_cmd(command)
|
39
|
+
cmd = Litterbox::Command.new(
|
40
|
+
command
|
41
|
+
)
|
42
|
+
cmd.run_command
|
43
|
+
cmd
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -11,7 +11,10 @@ module Litterbox
|
|
11
11
|
|
12
12
|
def upload(pkg = @pkg, auth = @auth)
|
13
13
|
raise 'file artifact not found' unless File.exist?(pkg)
|
14
|
-
|
14
|
+
raise 'must pass auth token' unless auth
|
15
|
+
cmd = "hab pkg upload #{pkg} -z #{auth}"
|
16
|
+
puts cmd
|
17
|
+
Open3.popen3(cmd) do |_, out, _, thr|
|
15
18
|
while (line = out.gets)
|
16
19
|
puts(line)
|
17
20
|
end
|
data/lib/litterbox/habitat.rb
CHANGED
data/lib/litterbox/version.rb
CHANGED
data/lib/litterbox.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'thor'
|
2
2
|
|
3
|
+
require 'litterbox/command'
|
3
4
|
require 'litterbox/habitat'
|
4
5
|
require 'litterbox/last_build'
|
5
6
|
require 'litterbox/version'
|
@@ -17,17 +18,18 @@ module Litterbox
|
|
17
18
|
end
|
18
19
|
|
19
20
|
desc 'upload PATH', 'upload the latest build'
|
20
|
-
def upload(path)
|
21
|
-
path ||= find_last_build
|
21
|
+
def upload(path = find_last_build)
|
22
22
|
raise "Could not find last_build.env in #{locations}" unless path
|
23
|
-
|
24
|
-
path = File.join(LAST_BUILD) unless path.include?(LAST_BUILD)
|
23
|
+
path = File.join(path, LAST_BUILD) unless path.include?(LAST_BUILD)
|
25
24
|
last_build = Litterbox.last_build(
|
26
25
|
path
|
27
26
|
)
|
27
|
+
plan_dir = path.dup
|
28
|
+
plan_dir.slice! LAST_BUILD
|
29
|
+
artifact = File.join(plan_dir, last_build.pkg_artifact)
|
28
30
|
|
29
31
|
Litterbox::Habitat::Upload.new(
|
30
|
-
|
32
|
+
artifact,
|
31
33
|
ENV['HAB_AUTH_TOKEN']
|
32
34
|
).upload
|
33
35
|
end
|
@@ -55,11 +57,9 @@ module Litterbox
|
|
55
57
|
File.join('.', 'results'),
|
56
58
|
File.join('habitat', 'results')
|
57
59
|
]
|
58
|
-
exists = {}
|
59
60
|
locations.each do |loc|
|
60
|
-
|
61
|
+
return loc if File.exist?(File.join(loc, LAST_BUILD))
|
61
62
|
end
|
62
|
-
exists.select { |_, v| v }.first
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
data/litterbox.gemspec
CHANGED
@@ -30,5 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
31
31
|
spec.add_development_dependency 'rubocop', '~> 0.52.1'
|
32
32
|
spec.add_development_dependency 'rubyzip', '~> 1.2.1'
|
33
|
+
spec.add_development_dependency 'yard'
|
33
34
|
spec.add_dependency 'thor', '~> 0.20.0'
|
34
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: litterbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- skylerto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 1.2.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: thor
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -149,11 +163,38 @@ files:
|
|
149
163
|
- bin/console
|
150
164
|
- bin/litterbox
|
151
165
|
- bin/setup
|
166
|
+
- docs/Litterbox.html
|
167
|
+
- docs/Litterbox/CLI.html
|
168
|
+
- docs/Litterbox/Command.html
|
169
|
+
- docs/Litterbox/Habitat.html
|
170
|
+
- docs/Litterbox/Habitat/Build.html
|
171
|
+
- docs/Litterbox/Habitat/Export.html
|
172
|
+
- docs/Litterbox/Habitat/Package.html
|
173
|
+
- docs/Litterbox/Habitat/Promote.html
|
174
|
+
- docs/Litterbox/Habitat/Upload.html
|
175
|
+
- docs/Litterbox/LastBuild.html
|
176
|
+
- docs/_index.html
|
177
|
+
- docs/class_list.html
|
178
|
+
- docs/css/common.css
|
179
|
+
- docs/css/full_list.css
|
180
|
+
- docs/css/style.css
|
181
|
+
- docs/file.README.html
|
182
|
+
- docs/file_list.html
|
183
|
+
- docs/frames.html
|
184
|
+
- docs/index.html
|
185
|
+
- docs/js/app.js
|
186
|
+
- docs/js/full_list.js
|
187
|
+
- docs/js/jquery.js
|
188
|
+
- docs/method_list.html
|
189
|
+
- docs/top-level-namespace.html
|
190
|
+
- exe/litterbox
|
152
191
|
- install_keys.sh
|
153
192
|
- lib/litterbox.rb
|
193
|
+
- lib/litterbox/command.rb
|
154
194
|
- lib/litterbox/habitat.rb
|
155
195
|
- lib/litterbox/habitat/build.rb
|
156
196
|
- lib/litterbox/habitat/export.rb
|
197
|
+
- lib/litterbox/habitat/package.rb
|
157
198
|
- lib/litterbox/habitat/promote.rb
|
158
199
|
- lib/litterbox/habitat/upload.rb
|
159
200
|
- lib/litterbox/last_build.rb
|