devkitkat 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitlab-ci.yml +1 -2
- data/Gemfile.lock +2 -2
- data/README.md +33 -25
- data/lib/devkitkat/command.rb +5 -3
- data/lib/devkitkat/executor/docker.rb +1 -1
- data/lib/devkitkat/main.rb +4 -2
- data/lib/devkitkat/service.rb +5 -0
- data/lib/devkitkat/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd732b290dba1a084ac162b2051b2a330039f4cd3d4ee29722dbaf0727512545
|
4
|
+
data.tar.gz: 1d2e08a9f0ee07756027eb1e89c78033653819ddb6381906fab07ee0424adc64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 955b9030e45a72faeff84a960556b78968f32e2d402e1ebc52c9a52cd599bd71a29063193af56bd439dd9ed0479e7f1d3fd0e3938ad2d737cb82868b9244ca85
|
7
|
+
data.tar.gz: 56b093d253840f1787df90d3932bfcb6e94af61fbca3d1cb1693e07bd0c843b7465e40ce7b7ccf9a0956f26735e75f4010ab9ede8cbbe404410c53b42778fda6
|
data/.gitlab-ci.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
devkitkat (0.1.
|
4
|
+
devkitkat (0.1.6)
|
5
5
|
activesupport (~> 6.0.0)
|
6
6
|
colorize (~> 0.8.1)
|
7
7
|
docker-api (~> 1.34.2)
|
@@ -31,7 +31,7 @@ GEM
|
|
31
31
|
concurrent-ruby (~> 1.0)
|
32
32
|
method_source (0.9.2)
|
33
33
|
minitest (5.12.2)
|
34
|
-
multi_json (1.14.
|
34
|
+
multi_json (1.14.1)
|
35
35
|
parallel (1.17.0)
|
36
36
|
pry (0.12.2)
|
37
37
|
coderay (~> 1.1.0)
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[![pipeline status](https://gitlab.com/dosuken123/devkitkat/badges/master/pipeline.svg)](https://gitlab.com/dosuken123/devkitkat/commits/master)
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/devkitkat.svg)](https://badge.fury.io/rb/devkitkat)
|
2
3
|
|
3
4
|
# Devkitkat
|
4
5
|
|
@@ -151,23 +152,40 @@ source ${MI_SYSTEM_SCRIPT_SHARED_DIR}
|
|
151
152
|
# Call a function defiend in the `shared` script
|
152
153
|
```
|
153
154
|
|
154
|
-
## Predefined scripts
|
155
|
+
## Utility commands, Predefined scripts and Options
|
155
156
|
|
156
157
|
Devkitkat provides predefined scripts that are useful in common development scenarios.
|
157
158
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
159
|
+
```
|
160
|
+
Usage: devkitkat <command/script> <target> [args] [options]
|
161
|
+
|
162
|
+
Options:
|
163
|
+
-p, --path PATH The root path of the .devkitkat.yml
|
164
|
+
--exclude SERVICE Exclude serviced from the specified target
|
165
|
+
-e, --env-var VARIABLE additional environment variables
|
166
|
+
-d, --depth DEPTH Git depth for pull/fetch
|
167
|
+
-r, --remote REMOTE Git remote
|
168
|
+
-b, --branch BRANCH Git branch
|
169
|
+
-t, --tty TTY mode. In this mode, log won't be emitted.
|
170
|
+
-v, --version Show version
|
171
|
+
-h, --help Show help
|
172
|
+
|
173
|
+
Utility Commands:
|
174
|
+
add-script - Add a script file
|
175
|
+
add-example - Add an example file
|
176
|
+
add-shared-script - Add s shared script
|
177
|
+
help - Show help
|
178
|
+
|
179
|
+
Predefined scripts:
|
180
|
+
clone - Clone repository
|
181
|
+
pull - Pull latest source code
|
182
|
+
clean - Clean the service dir
|
183
|
+
poop - Poop
|
184
|
+
```
|
185
|
+
|
186
|
+
Example:
|
187
|
+
|
188
|
+
`devkitkat start rails --path $HOME/awesome-app-dev-kit/ --env-var AWS_CRED=XXXXX`
|
171
189
|
|
172
190
|
## Predefined group names
|
173
191
|
|
@@ -220,7 +238,7 @@ For example, if you want to start `rails` service, your command would look like
|
|
220
238
|
|
221
239
|
`devkitkat start backend --exclude redis`
|
222
240
|
|
223
|
-
##
|
241
|
+
## Workflow example
|
224
242
|
|
225
243
|
```
|
226
244
|
devkitkat pull default # Pull source code for the default group
|
@@ -230,16 +248,6 @@ devkitkat seed rails # It Seeds for `rails` service
|
|
230
248
|
devkitkat start default # It starts services of the `default` group
|
231
249
|
```
|
232
250
|
|
233
|
-
## Options for `devkitkat`
|
234
|
-
|
235
|
-
- `--path /path/to/the` ... The root directory that contains `.devkitkat.yml` and manage the service dirs.
|
236
|
-
- `--variables KEY=VAR` ... The additional environment variables for services.
|
237
|
-
- `--exclude <name>` ... The excluded service from the group.
|
238
|
-
|
239
|
-
Example:
|
240
|
-
|
241
|
-
`devkitkat start rails --path $HOME/awesome-app-dev-kit/ --variables AWS_CRED=XXXXX`
|
242
|
-
|
243
251
|
## Installation
|
244
252
|
|
245
253
|
$ gem install devkitkat
|
data/lib/devkitkat/command.rb
CHANGED
@@ -35,7 +35,7 @@ module Devkitkat
|
|
35
35
|
|
36
36
|
def option_parser
|
37
37
|
@option_parser ||= OptionParser.new do |opts|
|
38
|
-
opts.banner = "Usage: devkitkat <script> <target> [options]"
|
38
|
+
opts.banner = "Usage: devkitkat <command/script> <target> [args] [options]"
|
39
39
|
opts.separator ""
|
40
40
|
opts.separator "Options:"
|
41
41
|
|
@@ -79,15 +79,17 @@ module Devkitkat
|
|
79
79
|
end
|
80
80
|
|
81
81
|
opts.separator ""
|
82
|
-
opts.separator "Commands:"
|
82
|
+
opts.separator "Utility Commands:"
|
83
83
|
opts.separator "add-script - Add a script file"
|
84
84
|
opts.separator "add-example - Add an example file"
|
85
85
|
opts.separator "add-shared-script - Add s shared script"
|
86
|
+
opts.separator "help - Show help"
|
87
|
+
opts.separator ""
|
88
|
+
opts.separator "Predefined scripts:"
|
86
89
|
opts.separator "clone - Clone repository"
|
87
90
|
opts.separator "pull - Pull latest source code"
|
88
91
|
opts.separator "clean - Clean the service dir"
|
89
92
|
opts.separator "poop - Poop"
|
90
|
-
opts.separator "help - Show help"
|
91
93
|
end
|
92
94
|
end
|
93
95
|
|
data/lib/devkitkat/main.rb
CHANGED
@@ -14,13 +14,13 @@ module Devkitkat
|
|
14
14
|
|
15
15
|
results = []
|
16
16
|
|
17
|
+
print_log_paths
|
18
|
+
|
17
19
|
if target_services.count == 1
|
18
20
|
# If the target is only one, it could be console access (TTY)
|
19
21
|
# so we can't run in parallel.
|
20
22
|
results << target_services.first.execute
|
21
23
|
else
|
22
|
-
print_log_paths
|
23
|
-
|
24
24
|
results = Parallel.map(target_services, progress: 'Executing', in_processes: 8) do |service|
|
25
25
|
service.execute.tap do |success|
|
26
26
|
raise Parallel::Kill unless success
|
@@ -39,6 +39,8 @@ module Devkitkat
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def print_log_paths
|
42
|
+
return if command.tty?
|
43
|
+
|
42
44
|
log_paths = target_services.map(&:log_path)
|
43
45
|
puts %Q{See the log at \n#{log_paths.join("\n")}}
|
44
46
|
end
|
data/lib/devkitkat/service.rb
CHANGED
data/lib/devkitkat/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devkitkat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shinya Maeda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|