Skip to content

Commit

Permalink
Prune for run as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Serghei Moret committed Jul 4, 2020
1 parent a2aea38 commit fe7d187
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
fastlane-plugin-mango (1.3.13)
fastlane-plugin-mango (1.3.15)
docker-api

GEM
Expand Down
6 changes: 6 additions & 0 deletions lib/fastlane/plugin/mango/helper/docker_commander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def pull_image(docker_image_name:)
end

def start_container(emulator_args:, docker_image:, core_amount:)
retries ||= 0
docker_name = if container_name
"--name #{container_name}"
else
Expand All @@ -33,6 +34,11 @@ def start_container(emulator_args:, docker_image:, core_amount:)
# interested in the last line, since it contains the id of the created container.
UI.important("Attaching #{ENV['PWD']} to the docker container")
Actions.sh("docker run -v $PWD:/root/tests --privileged -t -d #{core_amount} #{emulator_args} #{docker_name} #{docker_image}").chomp
rescue StandardError => exception
if exception.message =~ /Create more free space in thin pool/ && (retries += 1) < 2
prune
retry
end
end

def delete_container
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/mango/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fastlane
module Mango
VERSION = '1.3.14'.freeze
VERSION = '1.3.15'.freeze
end
end

0 comments on commit fe7d187

Please sign in to comment.