Skip to content

Commit

Permalink
Merge pull request #15 from SmartColumbusOS/project_name
Browse files Browse the repository at this point in the history
Removing project name from docker-compose calls
  • Loading branch information
bbalser authored Mar 26, 2019
2 parents c8ea92d + 483d07e commit 94962c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
6 changes: 1 addition & 5 deletions lib/divo/compose.ex
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,12 @@ defmodule Divo.Compose do
end

defp execute(action) do
app =
Helper.fetch_name()
|> to_string()

file =
Helper.fetch_config()
|> File.ensure_file()

args =
(["--project-name", app, "--file", file] ++ [action])
(["--file", file] ++ [action])
|> List.flatten()

Validate.validate(file)
Expand Down
12 changes: 3 additions & 9 deletions test/compose_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ defmodule Divo.ComposeTest do
Divo.Compose.run()

assert_called(
System.cmd("docker-compose", ["--project-name", "divo", "--file", "/tmp/divo.compose", "up", "--detach"],
stderr_to_stdout: true
),
System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "up", "--detach"], stderr_to_stdout: true),
once()
)
end
Expand All @@ -24,9 +22,7 @@ defmodule Divo.ComposeTest do
Divo.Compose.stop()

assert_called(
System.cmd("docker-compose", ["--project-name", "divo", "--file", "/tmp/divo.compose", "stop"],
stderr_to_stdout: true
),
System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "stop"], stderr_to_stdout: true),
once()
)
end
Expand All @@ -35,9 +31,7 @@ defmodule Divo.ComposeTest do
Divo.Compose.kill()

assert_called(
System.cmd("docker-compose", ["--project-name", "divo", "--file", "/tmp/divo.compose", "down"],
stderr_to_stdout: true
),
System.cmd("docker-compose", ["--file", "/tmp/divo.compose", "down"], stderr_to_stdout: true),
once()
)
end
Expand Down
8 changes: 4 additions & 4 deletions test/integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule IntegrationAllTest do
test "the full dependency stack is stood up" do
{containers, _} = System.cmd("docker", ["ps", "-a"], stderr_to_stdout: true)

assert String.contains?(containers, "divo_busybox_1")
assert String.contains?(containers, "busybox_1")
end
end

Expand All @@ -16,8 +16,8 @@ defmodule IntegrationPartialTest do
test "only specified parts of the stack are stood up" do
{containers, _} = System.cmd("docker", ["ps", "-a"], stderr_to_stdout: true)

assert String.contains?(containers, "divo_busybox_1") == false
assert String.contains?(containers, "divo_alpine_1") == true
assert String.contains?(containers, "busybox_1") == false
assert String.contains?(containers, "alpine_1") == true
end
end

Expand All @@ -32,7 +32,7 @@ defmodule IntegrationBuildTest do
Divo.Compose.run()

{containers, _} = System.cmd("docker", ["ps", "-a"], stderr_to_stdout: true)
assert String.contains?(containers, "divo_custom_app_1") == true
assert String.contains?(containers, "support_custom_app_1") == true

Divo.Compose.kill()
end
Expand Down

0 comments on commit 94962c6

Please sign in to comment.