lib/takeltau/ship/project/start.rb in takeltau-0.44.27 vs lib/takeltau/ship/project/start.rb in takeltau-0.44.29
- old
+ new
@@ -15,11 +15,13 @@
log.debug 'Writing port configuration to takelage.yml'
_ship_ports_lib_write_ports(ports, project)
log.debug "Starting takelship project \"#{project}\""
- _ship_container_lib_docker_privileged ports, project
+ ship_status = _ship_container_lib_docker_privileged ports, project
+ return false unless _ship_container_lib_started? ship_status
+
_ship_project_start_print_banner project
_ship_project_start_print_ports ports
true
end
@@ -46,9 +48,18 @@
def _ship_project_start_valid_project?(takelship, project)
return true if _ship_info_lib_valid_project? takelship, project
say 'No valid project found!'
say 'Try: ship project list'
+ false
+ end
+
+ # check if the ship started successfully
+ def _ship_container_lib_started?(ship_status)
+ return true if ship_status[2].zero?
+
+ say 'Unable to start the takelship. The error message was:'
+ say ship_status[1].to_s.strip.delete_prefix('"').delete_suffix('"')
false
end
# print banner with status information
def _ship_project_start_print_banner(project)