Pull latest image tag, so we can identity it
`docker image ls` doesn't tell us what the latest deployed image is (e.g if we've rolled back). Pull the latest image tag through to the server so we can use it instead.
This commit is contained in:
@@ -28,9 +28,8 @@ class CliAppTest < CliTestCase
|
||||
.returns([ :docker, :run ])
|
||||
|
||||
run_command("boot").tap do |output|
|
||||
assert_match "Rebooting container with same version 999 already deployed", output # Can't start what's already running
|
||||
assert_match "docker container ls --all --filter name=app-999 --quiet | xargs docker container rm", output # Stop old running
|
||||
assert_match "docker container ls --all --filter name=app-999 --quiet | xargs docker container rm", output # Remove old container
|
||||
assert_match "Rebooting container with same version latest already deployed", output # Can't start what's already running
|
||||
assert_match "docker container ls --all --filter name=app-latest --quiet | xargs docker container rm", output # Remove old container
|
||||
assert_match "docker run", output # Start new container
|
||||
end
|
||||
ensure
|
||||
|
||||
@@ -29,7 +29,7 @@ class CliBuildTest < CliTestCase
|
||||
test "pull" do
|
||||
run_command("pull").tap do |output|
|
||||
assert_match /docker image rm --force dhh\/app:999/, output
|
||||
assert_match /docker pull dhh\/app:999/, output
|
||||
assert_match /docker pull dhh\/app:latest/, output
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -189,12 +189,6 @@ class CommandsAppTest < ActiveSupport::TestCase
|
||||
new_command.current_running_version.join(" ")
|
||||
end
|
||||
|
||||
test "most_recent_version_from_available_images" do
|
||||
assert_equal \
|
||||
"docker image ls --format \"{{.Tag}}\" dhh/app | head -n 1",
|
||||
new_command.most_recent_version_from_available_images.join(" ")
|
||||
end
|
||||
|
||||
test "list_containers" do
|
||||
assert_equal \
|
||||
"docker container ls --all --filter label=service=app",
|
||||
|
||||
Reference in New Issue
Block a user