devkitkat 0.1.15 → 0.1.16

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 707204a31dc5981d5d933d6f7b268727b61cb8c535e1abf856ea8ea944095ed3
4
- data.tar.gz: e9358c4a44acc4636a55f42a0aaf862a103752a295702dd5f47e592a11f2fb0b
3
+ metadata.gz: 9503c19e647f80c25ed049cc5ff96089b903a953d5b42be1da32788236d6d2f2
4
+ data.tar.gz: 07f56dbc33f4a31bd5554148aef406d6ddd58ca0c3d690a630cba0fdb91ce175
5
5
  SHA512:
6
- metadata.gz: 26866d980e84a0d55205a6fb716b74a91a3ba7be1b2c0667fa84e9085c356bdb43cf82cc1434209065eb29c5fb13485ad5f19947305da72345ad6326f740eb75
7
- data.tar.gz: ce3de3f45076654f9972163f73c4f3ee641bde236fcefaa9c0312c46fa70d0d4e4f70feb1e3c743de6a735ef40fed58993d125c693c2a81f9893b3bf85a205d6
6
+ metadata.gz: ed82299c1adda7c574f7af3d007bea9fda838d98a98b9da77736870d0b9a528f30bcbc44e09ffc1568e1b6cbe750c77c71ff13fe3259b0b70ea5406d6ec3aba2
7
+ data.tar.gz: 44cd63fe05a894b2b98c8a2207c98558bea28799f46315d86ccc6ecb9ee2c06b9b004fb7090122238be4a1dbcf15bf4020027c789bd2b5c061ec3d73daf475ca
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devkitkat (0.1.15)
4
+ devkitkat (0.1.16)
5
5
  activesupport (~> 6.0.0)
6
6
  colorize (~> 0.8.1)
7
7
  docker-api (~> 1.34.2)
data/README.md CHANGED
@@ -163,10 +163,8 @@ Options:
163
163
  -p, --path PATH The root path of the .devkitkat.yml
164
164
  --exclude SERVICE Exclude serviced from the specified target
165
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.
166
+ -d, --debug Debug mode
167
+ -i, --interactive Interactive mode. STDOUT is streamed in console.
170
168
  -v, --version Show version
171
169
  -h, --help Show help
172
170
 
@@ -177,7 +175,7 @@ add-shared-script - Add s shared script
177
175
  help - Show help
178
176
 
179
177
  Predefined scripts:
180
- clone - Clone repository
178
+ clone - Clone repository (Available options: `GIT_DEPTH`)
181
179
  pull - Pull latest source code
182
180
  clean - Clean the service dir
183
181
  poop - Poop
@@ -12,8 +12,8 @@ module Devkitkat
12
12
  show_version if script == 'version'
13
13
  end
14
14
 
15
- def tty?
16
- options[:tty]
15
+ def interactive?
16
+ options[:interactive]
17
17
  end
18
18
 
19
19
  def variables
@@ -62,20 +62,8 @@ module Devkitkat
62
62
  options[:debug] = v
63
63
  end
64
64
 
65
- opts.on("-d", "--depth DEPTH", "Git depth for pull/fetch") do |v|
66
- options[:git_depth] = v
67
- end
68
-
69
- opts.on("-r", "--remote REMOTE", "Git remote") do |v|
70
- options[:git_remote] = v
71
- end
72
-
73
- opts.on("-b", "--branch BRANCH", "Git branch") do |v|
74
- options[:git_branch] = v
75
- end
76
-
77
- opts.on("-t", "--tty", "TTY mode. In this mode, log won't be emitted.") do |v|
78
- options[:tty] = v
65
+ opts.on("-i", "--interactive", "Interactive mode. STDOUT is streamed in console.") do |v|
66
+ options[:interactive] = v
79
67
  end
80
68
 
81
69
  opts.on("-v", "--version", "Show version") do |v|
@@ -95,7 +83,7 @@ module Devkitkat
95
83
  opts.separator "help - Show help"
96
84
  opts.separator ""
97
85
  opts.separator "Predefined scripts:"
98
- opts.separator "clone - Clone repository"
86
+ opts.separator "clone - Clone repository (Available options: `GIT_DEPTH`)"
99
87
  opts.separator "pull - Pull latest source code"
100
88
  opts.separator "clean - Clean the service dir"
101
89
  opts.separator "poop - Poop"
@@ -8,10 +8,6 @@ module Devkitkat
8
8
  end
9
9
 
10
10
  def execute
11
- if command.tty? && target_services.count > 1
12
- raise ArgumentError, 'TTY mode accepts only one service'
13
- end
14
-
15
11
  results = []
16
12
 
17
13
  print_log_paths
@@ -39,7 +35,7 @@ module Devkitkat
39
35
  end
40
36
 
41
37
  def print_log_paths
42
- return if command.tty?
38
+ return if command.interactive?
43
39
 
44
40
  log_paths = target_services.map(&:log_path)
45
41
  puts %Q{See the log at \n#{log_paths.join("\n")}}
@@ -139,7 +139,7 @@ set -e
139
139
  end
140
140
 
141
141
  def setup_logger
142
- return if command.tty?
142
+ return if command.interactive?
143
143
 
144
144
  executor.write("exec > #{log_path} 2>&1")
145
145
  end
@@ -209,22 +209,21 @@ See the log file: #{log_path}]
209
209
  def clone
210
210
  return unless repo_defined?
211
211
 
212
- options = []
212
+ cmd = <<-EOS
213
+ if [ -n "$GIT_DEPTH" ]; then
214
+ git clone #{repo} #{src_dir} --depth $GIT_DEPTH
215
+ else
216
+ git clone #{repo} #{src_dir}
217
+ fi
218
+ EOS
213
219
 
214
- if command.options[:git_depth]
215
- options << "--depth #{command.options[:git_depth]}"
216
- end
217
-
218
- executor.write("git clone #{repo} #{src_dir} #{options.join(' ')}")
220
+ executor.write(cmd)
219
221
  end
220
222
 
221
223
  def pull
222
224
  return unless repo_defined?
223
225
 
224
- remote = command.options[:git_remote] || 'origin'
225
- branch = command.options[:git_branch] || 'master'
226
-
227
- executor.write("git pull #{remote} #{branch}")
226
+ executor.write("git pull origin master")
228
227
  end
229
228
 
230
229
  def clean
@@ -1,3 +1,3 @@
1
1
  module Devkitkat
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
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.15
4
+ version: 0.1.16
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-22 00:00:00.000000000 Z
11
+ date: 2019-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler