lint
This commit is contained in:
parent
187135be42
commit
17637042b7
11
src/faaso.cr
11
src/faaso.cr
@ -18,16 +18,15 @@ module Faaso
|
|||||||
|
|
||||||
# Ensure the faaso-net network exists
|
# Ensure the faaso-net network exists
|
||||||
def self.setup_network
|
def self.setup_network
|
||||||
begin
|
|
||||||
docker_api = Docr::API.new(Docr::Client.new)
|
docker_api = Docr::API.new(Docr::Client.new)
|
||||||
docker_api.networks.create(Docr::Types::NetworkConfig.new(
|
docker_api.networks.create(Docr::Types::NetworkConfig.new(
|
||||||
name: "faaso-net",
|
name: "faaso-net",
|
||||||
check_duplicate: false,
|
check_duplicate: false,
|
||||||
driver: "bridge"
|
driver: "bridge"
|
||||||
))
|
))
|
||||||
rescue ex : Docr::Errors::DockerAPIError
|
rescue ex : Docr::Errors::DockerAPIError
|
||||||
raise ex if ex.status_code != 409 # Network already exists
|
raise ex if ex.status_code != 409 # Network already exists
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
module Commands
|
module Commands
|
||||||
@ -156,7 +155,7 @@ module Faaso
|
|||||||
end
|
end
|
||||||
|
|
||||||
# Deploy from scratch
|
# Deploy from scratch
|
||||||
Faaso.setup_network # We need it
|
Faaso.setup_network # We need it
|
||||||
puts "Creating new container"
|
puts "Creating new container"
|
||||||
conf = Docr::Types::CreateContainerConfig.new(
|
conf = Docr::Types::CreateContainerConfig.new(
|
||||||
image: "#{funko.name}:latest",
|
image: "#{funko.name}:latest",
|
||||||
@ -180,7 +179,7 @@ module Faaso
|
|||||||
filters: {"name" => [container_name]}
|
filters: {"name" => [container_name]}
|
||||||
)
|
)
|
||||||
|
|
||||||
(1..5).each { |i|
|
(1..5).each { |_|
|
||||||
break if containers[0].state == "running"
|
break if containers[0].state == "running"
|
||||||
sleep 0.1.seconds
|
sleep 0.1.seconds
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user