Commit f35a42f7 authored by Mark Lapierre's avatar Mark Lapierre

Wait for maven to finish deploying

The test builds a maven package in a docker container. The build
process can take a very different amount of time depending on how
long it takes to download all the dependencies and build.

There is an issue open to improve the test, but for now we make it
wait up to 5 minutes to build and deploy. We stop the container as
soon as deployment is complete so that it doesn't wait the full 5
minutes.

We also force delete the temp directory used to store the source for
the package because it seems to take some time for docker to release
the files after the container is stopped.
parent de1e2897
...@@ -30,7 +30,7 @@ module QA ...@@ -30,7 +30,7 @@ module QA
yield dir yield dir
ensure ensure
FileUtils.remove_entry(dir) FileUtils.remove_entry(dir, true)
end end
private private
......
...@@ -27,10 +27,16 @@ module QA ...@@ -27,10 +27,16 @@ module QA
--hostname #{host_name} --hostname #{host_name}
--name #{@name} --name #{@name}
--volume #{@volume_host_path}:/home/maven --volume #{@volume_host_path}:/home/maven
#{@image} sh -c "sleep 60" #{@image} sh -c "sleep 300"
CMD CMD
shell "docker cp #{@volume_host_path}/. #{@name}:/home/maven" shell "docker cp #{@volume_host_path}/. #{@name}:/home/maven"
shell "docker exec -t #{@name} sh -c 'cd /home/maven && mvn deploy -s settings.xml'" shell "docker exec -t #{@name} sh -c 'cd /home/maven && mvn deploy -s settings.xml'"
# Stop the container when `mvn deploy` is finished otherwise
# the sleeping container will hold onto the files in @volume_host_path,
# which causes problems when they're created in a tmp dir
# that we want to delete
shell "docker stop #{@name}"
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment