From 684daf43cc1518bb538a34a01f9ebff3bfebf541 Mon Sep 17 00:00:00 2001 From: Mike Cifelli Date: Wed, 3 Apr 2024 11:40:36 -0400 Subject: [PATCH] Prune deployed images --- lib/chronoscope/nts.ex | 9 ++++----- lib/mix/tasks/deploy.ex | 6 +++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/chronoscope/nts.ex b/lib/chronoscope/nts.ex index 2d76414..b87f1af 100644 --- a/lib/chronoscope/nts.ex +++ b/lib/chronoscope/nts.ex @@ -29,11 +29,10 @@ defmodule Chronoscope.NTS do [] -> {:ok, pid} = - NTS.DynamicSupervisor - |> DynamicSupervisor.start_child({ - NTS.Client, - host: host, port: port, name: {:via, Registry, {NTS.Registry, name}} - }) + DynamicSupervisor.start_child( + NTS.DynamicSupervisor, + {NTS.Client, host: host, port: port, name: {:via, Registry, {NTS.Registry, name}}} + ) GenServer.call(pid, :key_establishment) end diff --git a/lib/mix/tasks/deploy.ex b/lib/mix/tasks/deploy.ex index 392da48..56cec3d 100644 --- a/lib/mix/tasks/deploy.ex +++ b/lib/mix/tasks/deploy.ex @@ -27,6 +27,10 @@ defmodule Mix.Tasks.Deploy do into: IO.stream() ) - System.cmd("ssh", [host, "cd chronoscope && buildah build -t chronoscope:latest && podman auto-update"], into: IO.stream()) + System.cmd( + "ssh", + [host, "cd chronoscope && buildah build -t chronoscope:latest && podman auto-update && podman image prune -f"], + into: IO.stream() + ) end end