yu 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -15
- data/lib/yu.rb +10 -6
- data/lib/yu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a92783e2c1c90b67e2f7e86ca29c214a2590084a
|
4
|
+
data.tar.gz: 734abe78119bb4cb4242f98d48826c6169f62d84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1051b45b297987d900054b74ff4ef3d258a06ce5f80415a6ce06eea814e728a80ac85cba76a47f1a76921892ac36e9a56c29429ec79a0761305bace7eb7e28cc
|
7
|
+
data.tar.gz: 7ea52ab97d0217947fc36e08498638a73d947042cd3a07e519e59391eafae0c6204180c046bcba4856656554f76b50fb27b8bb096ec0e5a230a86c8d22876b73
|
data/README.md
CHANGED
@@ -1,28 +1,32 @@
|
|
1
1
|
# Yu
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
A microservice framework based on docker-compose
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
7
|
+
Install the CLI:
|
10
8
|
|
11
|
-
```
|
12
|
-
gem
|
9
|
+
```bash
|
10
|
+
$ gem install yu
|
13
11
|
```
|
14
12
|
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install yu
|
22
|
-
|
23
13
|
## Usage
|
24
14
|
|
25
|
-
|
15
|
+
```bash
|
16
|
+
yu --help
|
17
|
+
# Run all tests
|
18
|
+
yu test
|
19
|
+
# Test specific service(s)
|
20
|
+
yu test api
|
21
|
+
# Get a bash shell for a service
|
22
|
+
yu shell web
|
23
|
+
# Get a bash shell for testing a service
|
24
|
+
yu shell —test api
|
25
|
+
# Build base images for all services
|
26
|
+
yu build
|
27
|
+
# Build base image for specific service(s)
|
28
|
+
yu build api web
|
29
|
+
```
|
26
30
|
|
27
31
|
## Development
|
28
32
|
|
data/lib/yu.rb
CHANGED
@@ -34,6 +34,8 @@ module Yu
|
|
34
34
|
c.action(method(:shell))
|
35
35
|
end
|
36
36
|
|
37
|
+
global_option('-V', '--verbose', 'Verbose output') { $verbose_mode = true }
|
38
|
+
|
37
39
|
run!
|
38
40
|
end
|
39
41
|
|
@@ -51,7 +53,7 @@ module Yu
|
|
51
53
|
run_command(
|
52
54
|
"docker-compose run --rm #{container} bin/test",
|
53
55
|
showing_output: true,
|
54
|
-
exit_on_failure: false
|
56
|
+
exit_on_failure: false,
|
55
57
|
)
|
56
58
|
end
|
57
59
|
|
@@ -104,11 +106,13 @@ module Yu
|
|
104
106
|
|
105
107
|
def run_command(command, showing_output: false, exit_on_failure: true)
|
106
108
|
info "Running command: #{command}" if verbose_mode?
|
107
|
-
|
108
|
-
|
109
|
+
_, out_and_err, wait_thread = Open3.popen2e(command)
|
110
|
+
while line = out_and_err.gets
|
111
|
+
puts line if showing_output || verbose_mode?
|
112
|
+
end
|
109
113
|
|
110
|
-
|
111
|
-
unless
|
114
|
+
wait_thread.value.tap do |terminated_process|
|
115
|
+
unless terminated_process.success?
|
112
116
|
if block_given?
|
113
117
|
yield
|
114
118
|
else
|
@@ -127,7 +131,7 @@ module Yu
|
|
127
131
|
end
|
128
132
|
|
129
133
|
def verbose_mode?
|
130
|
-
|
134
|
+
!!$verbose_mode
|
131
135
|
end
|
132
136
|
|
133
137
|
def info(message)
|
data/lib/yu/version.rb
CHANGED