devkitkat 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c6847091630ff24eab8429d9a0e6fb8ca2391908b57080882f28c206b070606f
4
- data.tar.gz: 4318b208e648cc450a8f559f3b2c43981e430f72639af4a5ba055ce168e234a6
3
+ metadata.gz: 55796edb4547d60acd5924608760ba58eb8f32eb691e8cb7d06470992477d7b6
4
+ data.tar.gz: ed682227f7f5dcf62db337522fb7a136cf8f1eedf01fe2304c8c6289a13679cf
5
5
  SHA512:
6
- metadata.gz: 6543482740a252358646d811c3520e64cbdabcf1611e89c292c269e5577f2c9db4b4caa5928b8409cd4b2cfd223c5bc9bf6d0b069f4b4f4bf6f4ac0f80bf6873
7
- data.tar.gz: c996cde77945dc6892dd659736f0abbc1c4d5de25c0c8406f46c5a1cfdab8272aacaf42e2b5873de4b64ab2e19881be18c543ea49d588c1ae7a2688507a2a0c1
6
+ metadata.gz: 5650c0b7181067198511ee3c705d14b79a370926f76f04d49e24f4f15c0ac68b7c3bebb7fb435649c630fba1c5ce080c229bc4dac703564712036a6711178fee
7
+ data.tar.gz: 37d21b034badaa397bb81d9163c8f5e1c3038429773204e297dd7e60013bb84cfe77b285990b3065418d85b40c73779893bef81c54b4ccf8d3fee9272db50d7e
data/.gitlab-ci.yml CHANGED
@@ -1,8 +1,13 @@
1
+ stages:
2
+ - test
3
+ - release
4
+
1
5
  rspec:
2
6
  stage: test
3
7
  tags:
4
8
  - do-runner
5
9
  before_script:
10
+ - docker rm -f $(docker ps -a -q)
6
11
  - docker info
7
12
  - pwd
8
13
  - gem install bundler
@@ -10,6 +15,17 @@ rspec:
10
15
  script:
11
16
  - bundle exec rspec
12
17
 
18
+ release:
19
+ stage: release
20
+ tags:
21
+ - do-runner
22
+ script:
23
+ - bin/release
24
+ only:
25
+ changes:
26
+ - lib/devkitkat/version.rb
27
+ when: manual
28
+
13
29
  # services:
14
30
  # - docker:19.03.1-dind
15
31
 
data/Gemfile.lock CHANGED
@@ -1,11 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devkitkat (0.1.2)
4
+ devkitkat (0.1.3)
5
5
  activesupport (~> 6.0.0)
6
6
  colorize (~> 0.8.1)
7
7
  docker-api (~> 1.34.2)
8
8
  parallel (~> 1.17.0)
9
+ pry (~> 0.12.2)
10
+ pry-nav
9
11
  ruby-progressbar (~> 1.10.1)
10
12
 
11
13
  GEM
@@ -64,8 +66,6 @@ PLATFORMS
64
66
  DEPENDENCIES
65
67
  bundler (~> 1.17)
66
68
  devkitkat!
67
- pry (~> 0.12.2)
68
- pry-nav
69
69
  rake (~> 10.0)
70
70
  rspec (~> 3.0)
71
71
  rspec-temp_dir (~> 1.1.0)
@@ -12,34 +12,30 @@ module Devkitkat
12
12
  raise ArgumentError, 'TTY mode accepts only one service'
13
13
  end
14
14
 
15
+ results = []
16
+
15
17
  if target_services.count == 1
16
18
  # If the target is only one, it could be console access (TTY)
17
19
  # so we can't run in parallel.
18
- service = target_services.first
19
- execute_for(service)
20
+ results << target_services.first.execute
20
21
  else
21
22
  print_log_paths
22
23
 
23
- Parallel.map(target_services, progress: 'Executing', in_processes: 8) do |service|
24
- execute_for(service)
24
+ results = Parallel.map(target_services, progress: 'Executing', in_processes: 8) do |service|
25
+ service.execute.tap do |success|
26
+ raise Parallel::Kill unless success
27
+ end
25
28
  end
26
29
  end
30
+
31
+ exit(1) unless results&.all? { |result| result == true }
27
32
  end
28
33
 
29
34
  private
30
35
 
31
- def execute_for(service)
32
- begin
33
- service.execute!
34
- rescue Devkitkat::Service::ScriptError => e
35
- puts "Failure: #{e}".colorize(:red)
36
- raise Parallel::Kill
37
- end
38
- end
39
-
40
36
  def target_services
41
37
  @target_services ||= config.resolve!(command.target, exclude: command.options[:exclude])
42
- .map { |name| Service.new(name, config, command) }
38
+ .map { |name| Service.new(name, config, command) }
43
39
  end
44
40
 
45
41
  def print_log_paths
@@ -24,6 +24,16 @@ set -e
24
24
  @name, @config, @command = name, config, command
25
25
  end
26
26
 
27
+ def execute
28
+ execute!
29
+
30
+ true
31
+ rescue ScriptError => e
32
+ puts "Failure: #{e}".colorize(:red)
33
+
34
+ false
35
+ end
36
+
27
37
  def execute!
28
38
  executor.prepare
29
39
 
@@ -1,3 +1,3 @@
1
1
  module Devkitkat
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
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.3
4
+ version: 0.1.4
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-16 00:00:00.000000000 Z
11
+ date: 2019-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler