7 Commits
main ... v0.0.4

Author SHA1 Message Date
31da3d14a3 Pipeline update for act runner cache and registration endpoint name change
All checks were successful
Gitea CI/CD / dotnet-build-and-test (push) Successful in 10m40s
Gitea CI/CD / Set Tag Name (push) Successful in 5s
Gitea CI/CD / docker-build-and-push (push) Successful in 13m9s
Gitea CI/CD / Create Tag (push) Successful in 5s
2026-01-08 08:58:57 +01:00
ae8b60687a docker build fails at db migrations
All checks were successful
Gitea CI/CD / dotnet-build-and-test (push) Successful in 42s
Gitea CI/CD / Set Tag Name (push) Successful in 4s
Gitea CI/CD / docker-build-and-push (push) Successful in 1m33s
Gitea CI/CD / Create Tag (push) Successful in 4s
2026-01-07 14:24:47 +01:00
3fff8654fe container registry url
All checks were successful
Gitea CI/CD / dotnet-build-and-test (push) Successful in 40s
Gitea CI/CD / Set Tag Name (push) Successful in 5s
Gitea CI/CD / docker-build-and-push (push) Successful in 1m53s
Gitea CI/CD / Create Tag (push) Successful in 5s
2026-01-07 13:55:51 +01:00
9cfe9e2ab2 changed docker registry url
Some checks failed
Gitea CI/CD / dotnet-build-and-test (push) Successful in 43s
Gitea CI/CD / Set Tag Name (push) Successful in 5s
Gitea CI/CD / docker-build-and-push (push) Failing after 16s
Gitea CI/CD / Create Tag (push) Has been skipped
2026-01-07 13:52:45 +01:00
fd799d6158 removed arm64 build
All checks were successful
Gitea CI/CD / dotnet-build-and-test (push) Successful in 41s
Gitea CI/CD / Set Tag Name (push) Successful in 7s
Gitea CI/CD / docker-build-and-push (push) Successful in 1m49s
Gitea CI/CD / Create Tag (push) Successful in 5s
2026-01-07 13:38:21 +01:00
5f53207050 Merge branch 'main' of https://git.triggermeelmo.com/triggermeelmo/Watcher into staging
Some checks failed
Gitea CI/CD / dotnet-build-and-test (push) Successful in 42s
Gitea CI/CD / Set Tag Name (push) Successful in 6s
Gitea CI/CD / Create Tag (push) Has been cancelled
Gitea CI/CD / docker-build-and-push (push) Has been cancelled
2026-01-07 13:18:00 +01:00
02dfdd2a07 Dockerfile Fix
Some checks failed
Gitea CI/CD / dotnet-build-and-test (push) Failing after 25s
Gitea CI/CD / Set Tag Name (push) Has been skipped
Gitea CI/CD / docker-build-and-push (push) Has been skipped
Gitea CI/CD / Create Tag (push) Has been skipped
2026-01-07 13:15:10 +01:00
5 changed files with 75 additions and 23 deletions

View File

@@ -10,7 +10,7 @@ env:
DOTNET_VERSION: '8.0.x'
DOCKER_IMAGE_NAME: watcher-server
REGISTRY_URL: git.triggermeelmo.com
DOCKER_PLATFORMS: 'linux/amd64,linux/arm64'
DOCKER_PLATFORMS: 'linux/amd64'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -25,12 +25,14 @@ jobs:
with:
submodules: false
- name: List files for debugging
run: |
pwd
ls -la
find . -name "*.csproj"
find . -name "*.sln"
# NuGet Cache
- name: Cache NuGet packages
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
@@ -40,10 +42,16 @@ jobs:
- name: Restore dependencies
run: dotnet restore watcher-monitoring.sln
- name: Build
run: dotnet build watcher-monitoring.sln --configuration Release --no-restore
- name: Test
run: dotnet test watcher-monitoring.sln --no-build --verbosity normal
continue-on-error: true
set-tag:
name: Set Tag Name
needs: [dotnet-build-and-test]
#if: ${{ !failure() && !cancelled() && github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.set_tag.outputs.tag_name }}
@@ -105,6 +113,15 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
# Docker Layer Cache
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
@@ -112,13 +129,23 @@ jobs:
username: ${{ secrets.AUTOMATION_USERNAME }}
password: ${{ secrets.AUTOMATION_PASSWORD }}
- name: Build and Push Multi-Arch Docker Image
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ env.DOCKER_PLATFORMS }}
push: true
tags: ${{ env.REGISTRY_URL }}/triggermeelmo/${{ env.DOCKER_IMAGE_NAME }}:${{ needs.set-tag.outputs.tag_name }}
build-args: |
VERSION=${{ needs.set-tag.outputs.tag_name }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
# Workaround für Cache-Größe
- name: Move cache
run: |
docker buildx build \
--platform ${{ env.DOCKER_PLATFORMS }} \
--build-arg VERSION=${{ needs.set-tag.outputs.tag_name }} \
-t ${{ env.REGISTRY_URL }}/watcher/${{ env.DOCKER_IMAGE_NAME }}:${{ needs.set-tag.outputs.tag_name }} \
--push .
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
tag:
name: Create Tag

View File

@@ -4,12 +4,12 @@ WORKDIR /app
# Projektdateien kopieren und Abhängigkeiten wiederherstellen
COPY *.sln .
COPY watcher-monitoring/*.csproj ./Watcher/
COPY watcher-monitoring/*.csproj ./watcher-monitoring/
RUN dotnet restore
# Restliche Dateien kopieren und Build ausführen
COPY watcher-monitoring/. ./Watcher/
WORKDIR /app/Watcher
COPY watcher-monitoring/. ./watcher-monitoring/
WORKDIR /app/watcher-monitoring
RUN dotnet publish -c Release -o /app/publish /p:UseAppHost=false
# 2. Laufzeit-Phase: ASP.NET Core Runtime
@@ -43,6 +43,7 @@ USER watcher
# Expose Port 5000
EXPOSE 5000
ENV ASPNETCORE_URLS=http://*:5000
ENV ASPNETCORE_ENVIRONMENT=Production
@@ -50,4 +51,4 @@ ENV ASPNETCORE_ENVIRONMENT=Production
ENV WATCHER_VERSION=${VERSION}
# Anwendung starten
ENTRYPOINT ["dotnet", "Watcher.dll"]
ENTRYPOINT ["dotnet", "watcher-monitoring.dll"]

View File

@@ -1,6 +1,6 @@
services:
watcher:
image: git.triggermeelmo.com/watcher/watcher-server:latest
image: git.triggermeelmo.com/triggermeelmo/watcher-server:latest
container_name: watcher
# Resource Management
@@ -8,7 +8,6 @@ services:
resources:
limits:
memory: 200M
cpus: '0.5'
restart: unless-stopped

View File

@@ -20,8 +20,8 @@ public class MonitoringController : Controller
}
// Registration Endpoint for watcher-agent
[HttpPost("registration")]
public async Task<IActionResult> Registration([FromBody] RegistrationDto dto)
[HttpPost("register")]
public async Task<IActionResult> Register([FromBody] RegistrationDto dto)
{
// payload check
if (!ModelState.IsValid)

View File

@@ -52,6 +52,31 @@ builder.Services.AddSwaggerGen(options =>
var app = builder.Build();
// Stelle sicher, dass das persistence-Verzeichnis existiert
var persistenceDir = Path.Combine(Directory.GetCurrentDirectory(), "persistence");
if (!Directory.Exists(persistenceDir))
{
Log.Information("Erstelle persistence-Verzeichnis: {PersistenceDir}", persistenceDir);
Directory.CreateDirectory(persistenceDir);
}
// Datenbank-Migration beim Start ausführen
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<WatcherDbContext>();
try
{
Log.Information("Führe Datenbank-Migrationen aus...");
dbContext.Database.Migrate();
Log.Information("Datenbank-Migrationen erfolgreich angewendet");
}
catch (Exception ex)
{
Log.Error(ex, "Fehler beim Ausführen der Datenbank-Migrationen");
throw;
}
}
// Configure the HTTP request pipeline.
if (!app.Environment.IsDevelopment())
{