feat: Update 2 files
This commit is contained in:
@@ -154,10 +154,22 @@ namespace dropshell
|
|||||||
{
|
{
|
||||||
info << "Running " << service_info.template_name << " install script on " << server << "..." << std::endl;
|
info << "Running " << service_info.template_name << " install script on " << server << "..." << std::endl;
|
||||||
|
|
||||||
|
// Check if install.sh exists on remote
|
||||||
|
std::string install_script_path = remotepath(server,user).service_template(service) + "/install.sh";
|
||||||
|
if (!server_env.check_remote_file_exists(install_script_path, user))
|
||||||
|
{
|
||||||
|
error << "Install script not found on remote server: " << install_script_path << std::endl;
|
||||||
|
error << "Make sure the template '" << service_info.template_name << "' contains an install.sh script" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
shared_commands::cRemoteTempFolder remote_temp_folder(server_env, user);
|
shared_commands::cRemoteTempFolder remote_temp_folder(server_env, user);
|
||||||
if (!server_env.run_remote_template_command(service, "install", {}, false, {{"TEMP_DIR", remote_temp_folder.path()}}))
|
if (!server_env.run_remote_template_command(service, "install", {}, false, {{"TEMP_DIR", remote_temp_folder.path()}}))
|
||||||
{
|
{
|
||||||
error << "Failed to run install script on " << server << std::endl;
|
error << "Failed to run install script for service '" << service << "' on server '" << server << "'" << std::endl;
|
||||||
|
error << "Template: " << service_info.template_name << std::endl;
|
||||||
|
error << "Script path: " << install_script_path << std::endl;
|
||||||
|
error << "Check that the script is executable and has no syntax errors" << std::endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -184,8 +184,9 @@ namespace dropshell
|
|||||||
|
|
||||||
if (!rval && !hasFlag(mode, cMode::Silent))
|
if (!rval && !hasFlag(mode, cMode::Silent))
|
||||||
{
|
{
|
||||||
error << "Failed to execute ssh command:" << std::endl;
|
error << "Failed to execute ssh command" << std::endl;
|
||||||
debug << ssh_cmd.str() + " " + remote_command.construct_cmd(remote_bb64_path) << std::endl;
|
debug << "SSH command: " << ssh_cmd.str() << std::endl;
|
||||||
|
debug << "Remote command: " << remote_command.construct_cmd(remote_bb64_path) << std::endl;
|
||||||
}
|
}
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user