Skip to content

Commit

Permalink
clean up formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zacksiri committed Aug 13, 2024
1 parent 5b55ef1 commit b98499d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
14 changes: 11 additions & 3 deletions lib/pakman/push.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ defmodule Pakman.Push do
raise Error, message: "[Pakman.Push] #{inspect(error)}"

{:ok, %{"attributes" => attributes}} ->
Logger.info("[Pakman.Push] Deployment already exists copying existing...")
Logger.info(
"[Pakman.Push] Deployment already exists copying existing..."
)

copy(attributes, config)

Expand All @@ -58,8 +60,14 @@ defmodule Pakman.Push do

defp copy(%{"archive_path" => archive_path} = existing_deployment, config) do
with {:ok, token} <- Instellar.authenticate(),
{:ok, deployment_message, response} <- Instellar.create_deployment(token, archive_path, config),
{:ok, configuration_message, _response} <- Instellar.create_configuration(token, response["attributes"]["id"], config) do
{:ok, deployment_message, response} <-
Instellar.create_deployment(token, archive_path, config),
{:ok, configuration_message, _response} <-
Instellar.create_configuration(
token,
response["attributes"]["id"],
config
) do
print_deployment_message(deployment_message)
print_configuration_message(configuration_message)

Expand Down
6 changes: 3 additions & 3 deletions test/pakman/push_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ defmodule Pakman.PushTest do
"archive_path" => "archives/some-uuid/packages.zip"
}
}
}))
})
)
end)

Bypass.expect(bypass, "POST", "/publish/deployments", fn conn ->
Expand Down Expand Up @@ -153,8 +154,7 @@ defmodule Pakman.PushTest do
end
)

assert {:ok, :copied} =
Push.perform(config: "test/fixtures/rails.yml")
assert {:ok, :copied} = Push.perform(config: "test/fixtures/rails.yml")
end
end
end

0 comments on commit b98499d

Please sign in to comment.