dropshell release 2025.0524.1314
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 12s
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 12s
This commit is contained in:
@ -152,8 +152,9 @@ namespace dropshell
|
||||
recursive_copy(tinfo.local_template_path() / "config", service_dir);
|
||||
|
||||
// append TEMPLATE_HASH to the .template_info.env file
|
||||
std::string template_info_env_file = service_dir + "/" + filenames::template_info_env;
|
||||
std::ofstream template_info_env_file_out(template_info_env_file);
|
||||
std::string template_info_env_file = localfile::template_info_env(server_name,service_name);
|
||||
ASSERT(std::filesystem::exists(template_info_env_file), "Template info env file not found: " + template_info_env_file);
|
||||
std::ofstream template_info_env_file_out(template_info_env_file, std::ios::app); // append to the file.
|
||||
template_info_env_file_out << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
||||
template_info_env_file_out.close();
|
||||
|
||||
@ -249,9 +250,20 @@ namespace dropshell
|
||||
ASSERT(tinfo.is_set(), "Failed to load template " + service_info.template_name);
|
||||
|
||||
// copy across .template_info.env file
|
||||
std::string template_service_env_file = "";
|
||||
std::string target_service_env_file = localfile::template_info_env(server_name, service_name);
|
||||
ASSERT(std::filesystem::exists(template_service_env_file), "Template service env file not found: " + template_service_env_file);
|
||||
std::string template_info_env_file = tinfo.local_template_path() / "config" / filenames::template_info_env;
|
||||
std::string target_template_info_env_file = localfile::template_info_env(server_name, service_name);
|
||||
ASSERT(std::filesystem::exists(template_info_env_file), "Template service env file not found: " + template_info_env_file);
|
||||
std::filesystem::remove(target_template_info_env_file);
|
||||
std::filesystem::copy(template_info_env_file, target_template_info_env_file);
|
||||
|
||||
#pragma message("TODO: merge the template info env file")
|
||||
|
||||
// update hash in template info env file
|
||||
// append TEMPLATE_HASH to the .template_info.env file
|
||||
ASSERT(std::filesystem::exists(target_template_info_env_file), "Template info env file not found: " + target_template_info_env_file);
|
||||
std::ofstream template_info_env_file_out(target_template_info_env_file, std::ios::app); // append to the file.
|
||||
template_info_env_file_out << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
|
||||
template_info_env_file_out.close();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -67,10 +67,8 @@ namespace dropshell
|
||||
{
|
||||
std::string server = server_env.get_server_name();
|
||||
LocalServiceInfo service_info = get_service_info(server_env.get_server_name(), service);
|
||||
if (!SIvalid(service_info))
|
||||
return false;
|
||||
|
||||
if (!service_info.service_template_hash_match)
|
||||
if (!SIvalid(service_info) || !service_info.service_template_hash_match)
|
||||
{
|
||||
warning << "Service " << service << " is using an old template. Updating. " << std::endl;
|
||||
if (!merge_updated_service_template(server_env.get_server_name(), service))
|
||||
@ -78,6 +76,13 @@ namespace dropshell
|
||||
error << "Failed to merge updated service template. " << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
service_info = get_service_info(server_env.get_server_name(), service);
|
||||
if (!SIvalid(service_info) || !service_info.service_template_hash_match)
|
||||
{
|
||||
error << "Merged updated service template, but it is still not valid. " << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
maketitle("Installing " + service + " (" + service_info.template_name + ") on " + server);
|
||||
@ -276,7 +281,7 @@ namespace dropshell
|
||||
info << "Installing agent for user " << user.user << " on " << server.get_server_name() << std::endl;
|
||||
|
||||
std::string agent_path = remotepath(server.get_server_name(),user.user).agent();
|
||||
ASSERT(agent_path == user.dir, "Agent path does not match user directory for "+user.user+"@" + server.get_server_name() + " : " + agent_path + " != " + user.dir);
|
||||
ASSERT(agent_path == user.dir+"/agent", "Agent path does not match user directory for "+user.user+"@" + server.get_server_name() + " : " + agent_path + " != " + user.dir);
|
||||
ASSERT(!agent_path.empty(), "Agent path is empty for " + user.user + "@" + server.get_server_name());
|
||||
|
||||
// now create the agent.
|
||||
|
Reference in New Issue
Block a user