forked from mtusi2026/mtusi2026lab4
Хранить вложения в приватном S3 и сверять их с PostgreSQL.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
class Program
|
||||
{
|
||||
static int Run(string args)
|
||||
{
|
||||
string dir = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ".."));
|
||||
var start = new ProcessStartInfo("docker", args)
|
||||
{
|
||||
WorkingDirectory = dir,
|
||||
UseShellExecute = false
|
||||
};
|
||||
var process = Process.Start(start);
|
||||
process.WaitForExit();
|
||||
return process.ExitCode;
|
||||
}
|
||||
|
||||
static int Main()
|
||||
{
|
||||
string name = Path.GetFileName(Environment.GetCommandLineArgs()[0]).ToLowerInvariant();
|
||||
if (name.Contains("stop"))
|
||||
{
|
||||
string id = Environment.GetEnvironmentVariable("TARGET_INSTANCE_ID");
|
||||
if (id != "api-1" && id != "api-2") return 2;
|
||||
return Run("compose --env-file .env stop -t 2 " + id);
|
||||
}
|
||||
int up = Run("compose --env-file .env up -d --no-recreate --no-build postgres minio api-1 api-2 lb");
|
||||
if (up != 0) return up;
|
||||
return Run("compose --env-file .env restart postgres minio api-1 api-2 lb");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user