dropshell release 2025.0524.1149
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 17s

This commit is contained in:
Your Name
2025-05-24 11:49:24 +12:00
parent 0934179053
commit 763293c7d0
10 changed files with 64 additions and 60 deletions

View File

@ -152,7 +152,7 @@ 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 + "/.template_info.env";
std::string template_info_env_file = service_dir + "/" + filenames::template_info_env;
std::ofstream template_info_env_file_out(template_info_env_file);
template_info_env_file_out << "TEMPLATE_HASH=" << tinfo.hash() << std::endl;
template_info_env_file_out.close();
@ -191,12 +191,12 @@ namespace dropshell
}
info << "Setting SSH_USER to " << sshuser << " in service.env file" << std::endl;
info << "Setting SSH_USER to " << sshuser << " in the " << filenames::service_env << " file" << std::endl;
{ // edit the service.env file to set the SSH_USER.
std::string template_service_env_file = tinfo.local_template_path() / "config" / "service.env";
std::string template_service_env_file = tinfo.local_template_path() / "config" / filenames::service_env;
ASSERT(std::filesystem::exists(template_service_env_file), "Template service env file not found: " + template_service_env_file);
std::ifstream template_service_env_file_in(template_service_env_file);
std::ofstream service_env_file_out(service_dir + "/service.env");
std::ofstream service_env_file_out(localfile::template_info_env(server_name, service_name));
std::string line;
while (std::getline(template_service_env_file_in, line))
{
@ -239,6 +239,23 @@ namespace dropshell
return true;
}
bool merge_updated_service_template(const std::string &server_name, const std::string &service_name)
{
LocalServiceInfo service_info = get_service_info(server_name, service_name);
ASSERT(SIvalid(service_info), "Service info is not valid for " + service_name + " on " + server_name);
template_info tinfo = gTemplateManager().get_template_info(service_info.template_name);
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);
return true;
}
} // namespace shared_commands
} // namespace dropshell