Extract Cord, Assets, and Execution concerns from App

It was getting crowded!
This commit is contained in:
dhh
2023-09-16 09:51:45 -07:00
parent 880b8b267a
commit 07646bc020
5 changed files with 102 additions and 95 deletions

View File

@@ -0,0 +1,22 @@
module Kamal::Commands::App::Cord
def cord(version:)
pipe \
docker(:inspect, "-f '{{ range .Mounts }}{{printf \"%s %s\\n\" .Source .Destination}}{{ end }}'", container_name(version)),
[:awk, "'$2 == \"#{role_config.cord_volume.container_path}\" {print $1}'"]
end
def tie_cord(cord)
create_empty_file(cord)
end
def cut_cord(cord)
remove_directory(cord)
end
private
def create_empty_file(file)
chain \
make_directory_for(file),
[:touch, file]
end
end