fastlane-plugin-mango 1.3.15 → 1.3.23

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: 789e89cc42d904d6f20d595d4e4e5e536688431cef29839e784e6fbe8dfd7e13
4
- data.tar.gz: e4143d7a96c169910ec836972f4362b0244828f1899a7837b33911b62f31e7f3
3
+ metadata.gz: c5e9db6561834f87bc0a4c5607f7ca117532d38d35f846ed6a389e16c7da3223
4
+ data.tar.gz: fbdff88d36c647a249c76c58a9345e5aee75a23bc231ffcd01f86986bad41357
5
5
  SHA512:
6
- metadata.gz: '0243850ec81a9f5108d5c6ca0a46770238fced448407bdb0c6abacb734bc7804bedc58880275187908cf2a7993a52c635d84749d155d62265e8401788b53dcd4'
7
- data.tar.gz: f0dc414874f535ac73ba139fe5476516bc340d5b66b78fd162b6760ca4f783e4911d18ee4d36bec31032431869d093e6e364756ad7c216e6685bd91ae7846c61
6
+ metadata.gz: 3e015e871f2eceac9afb44618dab0023819f96d3066d709b540f2e7fdd4a830c970897d192f6ac0ac36a73d06fffb7992805a1ccc8f813439d3144d3a7abf569
7
+ data.tar.gz: 077d01545b646eea107ac015b1d7f847d8ffe41a66f1c33786ae0318d39b71e7ae6321564b9a420121f86c0676ae1150ce42774c57e00240694324fcb912f522
@@ -22,10 +22,23 @@ module Fastlane
22
22
 
23
23
  docker_commander.exec(command: "cd #{workspace_dir} #{bundle_install}&& #{timeout_command} #{android_task} || exit 1")
24
24
  end
25
+ rescue StandardError => e
26
+ begin
27
+ Actions.sh("docker logs #{mango_helper.container_name} --tail 200")
28
+ rescue StandardError
29
+ # do nothing
30
+ end
31
+ docker_commander.exec(command:
32
+ 'cat /var/log/supervisor/docker-android.stderr.log', raise_when_fail: false)
33
+ docker_commander.exec(command: 'cat /var/log/supervisor/supervisord.log',
34
+ raise_when_fail: false)
35
+ raise e
25
36
  ensure
26
37
  begin
27
38
  post_actions = params[:post_actions]
28
- docker_commander&.exec(command: "cd #{workspace_dir} && #{post_actions}") if post_actions && !mango_helper.kvm_disabled?
39
+ if post_actions && !mango_helper.kvm_disabled?
40
+ docker_commander&.exec(command: "cd #{workspace_dir} && #{post_actions}")
41
+ end
29
42
 
30
43
  UI.important("Cleaning up #{params[:emulator_name]} container")
31
44
  docker_commander.delete_container if mango_helper&.instance_variable_get('@container')
@@ -25,6 +25,7 @@ module Fastlane
25
25
  30.times do
26
26
  load = cpu_load
27
27
  return true if load <= cpu_core_amount.to_i * 1.5
28
+
28
29
  print_cpu_load(load)
29
30
  UI.important('Waiting for available resources..')
30
31
  sleep 60
@@ -11,8 +11,8 @@ module Fastlane
11
11
 
12
12
  def pull_image(docker_image_name:)
13
13
  Actions.sh("docker pull #{docker_image_name}")
14
- rescue StandardError => exception
15
- prune if exception.message =~ /Create more free space in thin pool/
14
+ rescue StandardError => e
15
+ prune if e.message =~ /Create more free space in thin pool/
16
16
  Actions.sh("docker pull #{docker_image_name}")
17
17
  end
18
18
 
@@ -34,8 +34,8 @@ module Fastlane
34
34
  # interested in the last line, since it contains the id of the created container.
35
35
  UI.important("Attaching #{ENV['PWD']} to the docker container")
36
36
  Actions.sh("docker run -v $PWD:/root/tests --privileged -t -d #{core_amount} #{emulator_args} #{docker_name} #{docker_image}").chomp
37
- rescue StandardError => exception
38
- if exception.message =~ /Create more free space in thin pool/ && (retries += 1) < 2
37
+ rescue StandardError => e
38
+ if e.message =~ /Create more free space in thin pool/ && (retries += 1) < 2
39
39
  prune
40
40
  retry
41
41
  end
@@ -52,9 +52,13 @@ module Fastlane
52
52
  # Do nothing if the network bridge is already gone
53
53
  end
54
54
 
55
- def exec(command:)
55
+ def exec(command:, raise_when_fail: true)
56
56
  if container_name
57
- Actions.sh("docker exec -i #{container_name} bash -l -c \"#{command}\"")
57
+ begin
58
+ Actions.sh("docker exec #{container_name} bash -l -c \"#{command}\"")
59
+ rescue StandardError => e
60
+ raise(e) if raise_when_fail
61
+ end
58
62
  else
59
63
  raise('Cannot execute docker command because the container name is unknown')
60
64
  end
@@ -6,7 +6,8 @@ require_relative 'cpu_load_handler'
6
6
  module Fastlane
7
7
  module Helper
8
8
  class MangoHelper
9
- attr_reader :container_name, :no_vnc_port, :device_name, :docker_image, :timeout, :port_factor, :maximal_run_time, :sleep_interval, :is_running_on_emulator, :environment_variables, :vnc_enabled, :core_amount
9
+ attr_reader :container_name, :no_vnc_port, :device_name, :docker_image, :timeout, :port_factor,
10
+ :maximal_run_time, :sleep_interval, :is_running_on_emulator, :environment_variables, :vnc_enabled, :core_amount
10
11
 
11
12
  def initialize(params)
12
13
  @container_name = params[:container_name]
@@ -162,7 +163,8 @@ module Fastlane
162
163
  end
163
164
  emulator_args = is_running_on_emulator ? "-p #{no_vnc_port}:6080 -e DEVICE='#{device_name}'" : ''
164
165
  emulator_args = "#{emulator_args}#{additional_env}"
165
- @docker_commander.start_container(emulator_args: emulator_args, docker_image: docker_image, core_amount: core_amount)
166
+ @docker_commander.start_container(emulator_args: emulator_args, docker_image: docker_image,
167
+ core_amount: core_amount)
166
168
  end
167
169
 
168
170
  def execute_pre_action
@@ -204,10 +206,11 @@ module Fastlane
204
206
  # Checks if container is already available
205
207
  def container_available?
206
208
  return false unless container_name
209
+
207
210
  all_containers = Docker::Container.all(all: true)
208
211
 
209
212
  all_containers.each do |container|
210
- if container.info['Names'].first[1..-1] == container_name
213
+ if container.info['Names'].first[1..] == container_name
211
214
  @container = container
212
215
  return true
213
216
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Mango
3
- VERSION = '1.3.15'.freeze
3
+ VERSION = '1.3.23'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-mango
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.15
4
+ version: 1.3.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serghei Moret, Daniel Hartwich
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-04 00:00:00.000000000 Z
11
+ date: 2021-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api
@@ -112,16 +112,16 @@ dependencies:
112
112
  name: rubocop
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.58.2
117
+ version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.58.2
124
+ version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- description:
139
+ description:
140
140
  email: serghei.moret@xing.com, hartwich.daniel@gmail.com
141
141
  executables: []
142
142
  extensions: []
@@ -155,7 +155,7 @@ homepage: https://github.com/xing/mango
155
155
  licenses:
156
156
  - MIT
157
157
  metadata: {}
158
- post_install_message:
158
+ post_install_message:
159
159
  rdoc_options: []
160
160
  require_paths:
161
161
  - lib
@@ -170,8 +170,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  - !ruby/object:Gem::Version
171
171
  version: '0'
172
172
  requirements: []
173
- rubygems_version: 3.0.6
174
- signing_key:
173
+ rubygems_version: 3.1.2
174
+ signing_key:
175
175
  specification_version: 4
176
176
  summary: This plugin Android tasks on docker images
177
177
  test_files: []