Aligning the different parts with the new directory and file structure.
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
This commit is contained in:
@ -182,7 +182,7 @@ std::map<std::string, ServiceStatus> service_runner::get_all_services_status(std
|
||||
}
|
||||
|
||||
std::string output;
|
||||
if (!execute_ssh_command(env.get_SSH_INFO(), sCommand(remotepath::agent(server_name), "./_allservicesstatus.sh", {}), cMode::CaptureOutput, &output))
|
||||
if (!execute_ssh_command(env.get_SSH_INFO(), sCommand(remotepath::agent(server_name), "./_allservicesstatus.sh", {{"HOST_NAME", server_name}}), cMode::CaptureOutput, &output))
|
||||
return status;
|
||||
|
||||
std::stringstream ss(output);
|
||||
|
@ -225,15 +225,17 @@ bool get_all_service_env_vars(const std::string &server_name, const std::string
|
||||
return false;
|
||||
}
|
||||
|
||||
ServerInfo server_info = get_server_info(server_name);
|
||||
if (server_info.ssh_host.empty())
|
||||
std::cerr << "Error: Server " << server_name << " not found - ssh_host empty, so HOST_NAME not set" << std::endl;
|
||||
|
||||
|
||||
// add in some handy variables.
|
||||
// if we change these, we also need to update agent/_allservicesstatus.sh
|
||||
all_env_vars["CONFIG_PATH"] = remotepath::service_config(server_name,service_name);
|
||||
all_env_vars["SERVER"] = server_name;
|
||||
all_env_vars["SERVICE"] = service_name;
|
||||
all_env_vars["AGENT_PATH"] = remotepath::agent(server_name);
|
||||
|
||||
ServerInfo server_info = get_server_info(server_name);
|
||||
if (server_info.ssh_host.empty())
|
||||
std::cerr << "Error: Server " << server_name << " not found - ssh_host empty, so HOST_NAME not set" << std::endl;
|
||||
all_env_vars["HOST_NAME"] = server_info.ssh_host;
|
||||
|
||||
// Lambda function to load environment variables from a file
|
||||
|
@ -83,23 +83,27 @@ namespace localpath {
|
||||
}
|
||||
} // namespace localpath
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------------------------
|
||||
// remote paths
|
||||
// DROPSHELL_DIR
|
||||
// |-- backups
|
||||
// |-- temp_files
|
||||
// |-- agent
|
||||
// | |-- bb64
|
||||
// | |-- (other agent files, including _allservicesstatus.sh)
|
||||
// |-- services
|
||||
// |-- service name
|
||||
// |-- config
|
||||
// |-- service.env
|
||||
// |-- service.env (actual service config)
|
||||
// |-- template
|
||||
// |-- _default.env
|
||||
// |-- (script files)
|
||||
// |-- config
|
||||
// |-- service.env
|
||||
// |-- service.env (default service config)
|
||||
// |-- (other config files for specific server&service)
|
||||
|
||||
|
||||
|
||||
namespace remotefile {
|
||||
|
||||
std::string service_env(const std::string &server_name, const std::string &service_name)
|
||||
|
@ -76,11 +76,14 @@ namespace dropshell {
|
||||
// |-- services
|
||||
// |-- service name
|
||||
// |-- config
|
||||
// |-- service.env
|
||||
// |-- service.env (actual service config)
|
||||
// |-- .template_info.env
|
||||
// |-- template
|
||||
// |-- _default.env
|
||||
// |-- (script files)
|
||||
// |-- config
|
||||
// |-- service.env
|
||||
// |-- service.env (default service config)
|
||||
// |-- .template_info.env
|
||||
// |-- (other config files for specific server&service)
|
||||
|
||||
namespace remotefile {
|
||||
|
Reference in New Issue
Block a user