2023-10-24 08:06:07 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-11-12 09:07:23 +00:00
|
|
|
|
using KubernetesWorkflow.Recipe;
|
2023-10-25 09:53:33 +00:00
|
|
|
|
using Utils;
|
2023-10-24 08:06:07 +00:00
|
|
|
|
|
|
|
|
|
namespace CodexDiscordBotPlugin
|
|
|
|
|
{
|
|
|
|
|
public class DiscordBotContainerRecipe : ContainerRecipeFactory
|
|
|
|
|
{
|
|
|
|
|
public override string AppName => "discordbot-bibliotech";
|
|
|
|
|
public override string Image => "thatbenbierens/codex-discordbot:initial";
|
|
|
|
|
|
|
|
|
|
protected override void Initialize(StartupConfig startupConfig)
|
|
|
|
|
{
|
|
|
|
|
var config = startupConfig.Get<DiscordBotStartupConfig>();
|
|
|
|
|
|
2023-11-14 09:16:00 +00:00
|
|
|
|
SetSchedulingAffinity(notIn: "tests-runners");
|
|
|
|
|
|
2023-10-24 08:06:07 +00:00
|
|
|
|
AddEnvVar("TOKEN", config.Token);
|
|
|
|
|
AddEnvVar("SERVERNAME", config.ServerName);
|
|
|
|
|
AddEnvVar("ADMINROLE", config.AdminRoleName);
|
2023-10-25 08:38:21 +00:00
|
|
|
|
AddEnvVar("ADMINCHANNELNAME", config.AdminChannelName);
|
2023-10-25 09:53:33 +00:00
|
|
|
|
|
2023-10-25 12:33:47 +00:00
|
|
|
|
if (!string.IsNullOrEmpty(config.DataPath))
|
2023-10-25 09:53:33 +00:00
|
|
|
|
{
|
|
|
|
|
AddEnvVar("DATAPATH", config.DataPath);
|
|
|
|
|
AddVolume(config.DataPath, 1.GB());
|
|
|
|
|
}
|
2023-10-24 08:06:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|