add: terminal tool
This commit is contained in:
13
.idea/.idea.Alchegos.Gitea.Webhook/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.Alchegos.Gitea.Webhook/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/modules.xml
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.Alchegos.Gitea.Webhook.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
13
.idea/.idea.Alchegos.Webhook/.idea/.gitignore
generated
vendored
Normal file
13
.idea/.idea.Alchegos.Webhook/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.Alchegos.Webhook.iml
|
||||
/contentModel.xml
|
||||
/modules.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@@ -12,8 +12,8 @@
|
||||
<Content Include="..\.dockerignore">
|
||||
<Link>.dockerignore</Link>
|
||||
</Content>
|
||||
<PackageReference Include="Alchegos.Core" Version="0.0.1" />
|
||||
<PackageReference Include="RabbitMQ.Client" Version="7.1.1" />
|
||||
<ProjectReference Include="..\Alchegos.Core\Alchegos.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Alchegos.Gitea.Webhook;
|
||||
namespace Alchegos.Webhook;
|
||||
|
||||
public class AlchegosEventDispatcher
|
||||
{
|
||||
|
||||
12
Dockerfile
12
Dockerfile
@@ -7,17 +7,17 @@ EXPOSE 8080
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["Alchegos.Gitea.Webhook/Alchegos.Gitea.Webhook.csproj", "Alchegos.Gitea.Webhook/"]
|
||||
RUN dotnet restore "Alchegos.Gitea.Webhook/Alchegos.Gitea.Webhook.csproj"
|
||||
COPY ["Alchegos.Webhook.csproj", "./"]
|
||||
RUN dotnet restore "Alchegos.Webhook.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/Alchegos.Gitea.Webhook"
|
||||
RUN dotnet build "Alchegos.Gitea.Webhook.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
WORKDIR "/src/Alchegos.Webhook"
|
||||
RUN dotnet build "/src/Alchegos.Webhook.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "Alchegos.Gitea.Webhook.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
RUN dotnet publish "Alchegos.Webhook.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "Alchegos.Gitea.Webhook.dll"]
|
||||
ENTRYPOINT ["dotnet", "Alchegos.Webhook.dll"]
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
using Alchegos.Gitea.Webhook.Handlers;
|
||||
using Alchegos.Webhook.Handlers;
|
||||
using Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook;
|
||||
namespace Alchegos.Webhook;
|
||||
|
||||
public class GiteaEventDispatcher
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.AlchegosEventHandlers;
|
||||
|
||||
public interface IAlchegosEventHandler : IWebhookEventHandler
|
||||
{
|
||||
12
Handlers/AlchegosEventHandlers/ProjectPlanEventHandler.cs
Normal file
12
Handlers/AlchegosEventHandlers/ProjectPlanEventHandler.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Webhook.Handlers.AlchegosEventHandlers;
|
||||
|
||||
public class ProjectPlanEventHandler : IAlchegosEventHandler
|
||||
{
|
||||
public Task HandleAsync(JsonNode payload, IRabbitPublisher publisher)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
public interface IGiteaEventHandler: IWebhookEventHandler
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
public class IssueCommentEventHandler : IGiteaEventHandler
|
||||
{
|
||||
@@ -11,7 +11,7 @@ public class IssueCommentEventHandler : IGiteaEventHandler
|
||||
if (payload["action"]?.ToString() != "created")
|
||||
return;
|
||||
|
||||
var message = new Dictionary<string, string>
|
||||
Dictionary<string, string> message = new Dictionary<string, string>
|
||||
{
|
||||
{"repo_url", payload["repository"]?["url"]?.ToString()},
|
||||
{"repo_owner", payload["repository"]?["owner"]?["login"]?.ToString()},
|
||||
@@ -2,7 +2,7 @@ using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
public class IssuesEventHandler : IGiteaEventHandler
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
public class PullRequestEventHandler : IGiteaEventHandler
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
public class PushEventHandler : IGiteaEventHandler
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers;
|
||||
|
||||
public interface IWebhookEventHandler
|
||||
{
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
using Alchegos.Webhook.Handlers.GiteaEventHandlers;
|
||||
|
||||
namespace Alchegos.Gitea.Webhook.Handlers;
|
||||
namespace Alchegos.Webhook.Handlers;
|
||||
|
||||
public class ProjectPlanEventHandler : IGiteaEventHandler
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Text.Json.Nodes;
|
||||
using Alchegos.Core;
|
||||
using Alchegos.Core.Services.RabbitMQ;
|
||||
using Alchegos.Gitea.Webhook;
|
||||
using Alchegos.Webhook;
|
||||
|
||||
|
||||
GlobalRegistry.Instance.Start();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"profiles": {
|
||||
"Alchegos.Gitea.Webhook": {
|
||||
"Alchegos.Webhook": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"environmentVariables": {
|
||||
|
||||
37
summerizer
Executable file
37
summerizer
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/python3
|
||||
import os
|
||||
|
||||
ignores = [
|
||||
'bin',
|
||||
'obj',
|
||||
'.godot',
|
||||
'.idea',
|
||||
'icon.svg',
|
||||
'icon.svg.import',
|
||||
"Resources",
|
||||
"GiteaApiClient.cs"
|
||||
]
|
||||
def find_all_proj_files(base_path):
|
||||
res = []
|
||||
for root, dirs, files in os.walk(base_path):
|
||||
dirs[:] = [d for d in dirs if not d.startswith('.') and not d in ignores]
|
||||
for file in files:
|
||||
if file not in ignores:
|
||||
res.append(os.path.join(root, file))
|
||||
return res
|
||||
|
||||
|
||||
def summerizer():
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
fs = find_all_proj_files(current_dir)
|
||||
res = ""
|
||||
for file in fs:
|
||||
with open(file) as f:
|
||||
res += f"---------------------{file}-------------------------\n"
|
||||
res += f.read()
|
||||
res += "\n"
|
||||
print(res)
|
||||
|
||||
summerizer()
|
||||
Reference in New Issue
Block a user