Detect container dynamically
Containers are taken down of course!
This commit is contained in:
+10
-1
@@ -9,7 +9,16 @@ if ARGV.size != 1
|
||||
end
|
||||
|
||||
tenant_id = ARGV[0]
|
||||
CONTAINER = "fizzy-web-production-b2f4038ea1fd054e313308940d9e445428f35b23"
|
||||
|
||||
# Automatically detect the fizzy-web-production container
|
||||
puts "→ Detecting fizzy-web-production container..."
|
||||
container_output, status = Open3.capture2(%(ssh app@fizzy-app-101 "docker ps --format '{{.Names}}' | grep fizzy-web-production"))
|
||||
abort("Failed to detect container") unless status.success?
|
||||
|
||||
CONTAINER = container_output.strip
|
||||
abort("No fizzy-web-production container found") if CONTAINER.empty?
|
||||
puts "→ Using container: #{CONTAINER}"
|
||||
|
||||
REMOTE_PATH = "/rails/storage/tenants/production/#{tenant_id}/db/main.sqlite3.1"
|
||||
|
||||
Dir.mktmpdir do |tmpdir|
|
||||
|
||||
Reference in New Issue
Block a user