fastlane-plugin-mango 1.3.15 → 1.3.23
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 +4 -4
- data/lib/fastlane/plugin/mango/actions/run_dockerized_task_action.rb +14 -1
- data/lib/fastlane/plugin/mango/helper/cpu_load_handler.rb +1 -0
- data/lib/fastlane/plugin/mango/helper/docker_commander.rb +10 -6
- data/lib/fastlane/plugin/mango/helper/mango_helper.rb +6 -3
- data/lib/fastlane/plugin/mango/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5e9db6561834f87bc0a4c5607f7ca117532d38d35f846ed6a389e16c7da3223
|
|
4
|
+
data.tar.gz: fbdff88d36c647a249c76c58a9345e5aee75a23bc231ffcd01f86986bad41357
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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')
|
|
@@ -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 =>
|
|
15
|
-
prune if
|
|
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 =>
|
|
38
|
-
if
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
|
213
|
+
if container.info['Names'].first[1..] == container_name
|
|
211
214
|
@container = container
|
|
212
215
|
return true
|
|
213
216
|
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.
|
|
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:
|
|
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
|
|
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
|
|
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.
|
|
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: []
|