Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2a9cb2b2fb | |||
| ef9a825dc2 | |||
| 8b4792cb5c | |||
| 8a16658dfe | |||
| 0fa955f794 | |||
| a2f378708f | |||
| 46b0b99a64 |
@@ -8,7 +8,7 @@ variables:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
script:
|
script:
|
||||||
- dotnet restore
|
- dotnet restore
|
||||||
- dotnet build --configuration Release --no-restore
|
- dotnet build --configuration Release --no-restore
|
||||||
@@ -19,7 +19,7 @@ build:
|
|||||||
|
|
||||||
test:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
image: mcr.microsoft.com/dotnet/sdk:9.0
|
image: mcr.microsoft.com/dotnet/sdk:10.0
|
||||||
script:
|
script:
|
||||||
- dotnet test --verbosity normal
|
- dotnet test --verbosity normal
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -27,13 +27,13 @@ test:
|
|||||||
|
|
||||||
publish:
|
publish:
|
||||||
stage: publish
|
stage: publish
|
||||||
image: docker:latest
|
tags:
|
||||||
services:
|
- docker
|
||||||
- name: docker:dind
|
before_script:
|
||||||
alias: docker
|
- git lfs pull
|
||||||
script:
|
script:
|
||||||
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
|
- export VERSION=$(echo $CI_COMMIT_TAG | sed 's/^v//')
|
||||||
- docker login -u leon.hoppe -p ${CI_REGISTRY_PASSWORD} registry.leon-hoppe.de
|
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin registry.leon-hoppe.de
|
||||||
- docker build -t $DOCKER_IMAGE/api:$VERSION -t $DOCKER_IMAGE/api:latest -f src/Portfolio.Api/Dockerfile .
|
- docker build -t $DOCKER_IMAGE/api:$VERSION -t $DOCKER_IMAGE/api:latest -f src/Portfolio.Api/Dockerfile .
|
||||||
- docker build -t $DOCKER_IMAGE/web:$VERSION -t $DOCKER_IMAGE/web:latest -f src/Portfolio.Web/Dockerfile .
|
- docker build -t $DOCKER_IMAGE/web:$VERSION -t $DOCKER_IMAGE/web:latest -f src/Portfolio.Web/Dockerfile .
|
||||||
- docker push $DOCKER_IMAGE/api:$VERSION
|
- docker push $DOCKER_IMAGE/api:$VERSION
|
||||||
|
|||||||
7
global.json
Normal file
7
global.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "10.0.0",
|
||||||
|
"rollForward": "latestMajor",
|
||||||
|
"allowPrerelease": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
@using Microsoft.AspNetCore.Components.Web;
|
|
||||||
@using Microsoft.AspNetCore.Components.Routing
|
|
||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8"/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
|
||||||
<base href="/"/>
|
|
||||||
<link rel="stylesheet" href="@Assets["Portfolio.Api.styles.css"]"/>
|
|
||||||
<link rel="stylesheet" href="@Assets["_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css"]"/>
|
|
||||||
<ImportMap/>
|
|
||||||
<link rel="icon" type="image/png" href="favicon.png"/>
|
|
||||||
<HeadOutlet/>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
--body-font: "Segoe UI Variable", "Segoe UI", sans-serif;
|
|
||||||
font-family: var(--body-font), sans-serif;
|
|
||||||
font-size: var(--type-ramp-base-font-size);
|
|
||||||
line-height: var(--type-ramp-base-line-height);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer {
|
|
||||||
background: var(--neutral-layer-4);
|
|
||||||
color: var(--neutral-foreground-rest);
|
|
||||||
align-items: center;
|
|
||||||
padding: 10px 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a {
|
|
||||||
color: var(--neutral-foreground-rest);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a:focus {
|
|
||||||
outline: 1px dashed;
|
|
||||||
outline-offset: 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
footer a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<Router AppAssembly="typeof(Program).Assembly">
|
|
||||||
<Found Context="routeData">
|
|
||||||
<RouteView RouteData="routeData"/>
|
|
||||||
</Found>
|
|
||||||
</Router>
|
|
||||||
<script src="_framework/blazor.web.js"></script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -8,10 +8,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.0" />
|
<PackageReference Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="13.0.2" />
|
||||||
<PackageReference Include="Aspire.StackExchange.Redis.OutputCaching" Version="9.0.0" />
|
<PackageReference Include="Aspire.StackExchange.Redis.OutputCaching" Version="13.0.2" />
|
||||||
<PackageReference Include="HopFrame.Web" Version="3.0.0" />
|
<PackageReference Include="HopFrame.Web" Version="3.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.0"/>
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="9.0.11" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using HopFrame.Core.Config;
|
|
||||||
using HopFrame.Web;
|
using HopFrame.Web;
|
||||||
using Portfolio.Api;
|
using Portfolio.Api;
|
||||||
using Portfolio.Api.Services;
|
using Portfolio.Api.Services;
|
||||||
@@ -31,25 +30,8 @@ builder.Services.AddHopFrame(options => {
|
|||||||
options.DisplayUserInfo(false);
|
options.DisplayUserInfo(false);
|
||||||
options.AddDbContext<DatabaseContext>(context => {
|
options.AddDbContext<DatabaseContext>(context => {
|
||||||
context.Table<Project>(table => {
|
context.Table<Project>(table => {
|
||||||
var langConfig = table.InnerConfig.Properties
|
|
||||||
.Single(prop => prop.Name == nameof(Project.Languages));
|
|
||||||
|
|
||||||
langConfig
|
|
||||||
.GetType()!
|
|
||||||
.GetProperty(nameof(PropertyConfig.IsRelation))!
|
|
||||||
.SetValue(langConfig, true);
|
|
||||||
|
|
||||||
langConfig
|
|
||||||
.GetType()!
|
|
||||||
.GetProperty(nameof(PropertyConfig.IsEnumerable))!
|
|
||||||
.SetValue(langConfig, true);
|
|
||||||
|
|
||||||
langConfig
|
|
||||||
.GetType()!
|
|
||||||
.GetProperty(nameof(PropertyConfig.IsRequired))!
|
|
||||||
.SetValue(langConfig, true);
|
|
||||||
|
|
||||||
table.Property(p => p.Languages)
|
table.Property(p => p.Languages)
|
||||||
|
.ForceRelation(isEnumerable: true)
|
||||||
.FormatEach<Technology>((l, _) => l.Name)
|
.FormatEach<Technology>((l, _) => l.Name)
|
||||||
.List(false);
|
.List(false);
|
||||||
|
|
||||||
@@ -57,7 +39,6 @@ builder.Services.AddHopFrame(options => {
|
|||||||
.List(false);
|
.List(false);
|
||||||
|
|
||||||
table.Property(p => p.Description)
|
table.Property(p => p.Description)
|
||||||
.List(false)
|
|
||||||
.IsTextArea(true);
|
.IsTextArea(true);
|
||||||
|
|
||||||
table.Property(p => p.SourceCode)
|
table.Property(p => p.SourceCode)
|
||||||
@@ -66,23 +47,20 @@ builder.Services.AddHopFrame(options => {
|
|||||||
|
|
||||||
context.Table<About>(table => {
|
context.Table<About>(table => {
|
||||||
table.Property(a => a.AboutMe)
|
table.Property(a => a.AboutMe)
|
||||||
.List(false)
|
.SetDisplayLength(100)
|
||||||
.IsTextArea(true);
|
.IsTextArea(true);
|
||||||
|
|
||||||
table.Property(a => a.Future)
|
table.Property(a => a.Future)
|
||||||
.List(false)
|
.SetDisplayLength(100)
|
||||||
.IsTextArea(true);
|
.IsTextArea(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
context.Table<TimelineEntry>(table => {
|
context.Table<TimelineEntry>(table => {
|
||||||
table.Property(t => t.Description)
|
table.Property(t => t.Description)
|
||||||
.IsTextArea(true)
|
.IsTextArea(true);
|
||||||
.List(false);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
builder.Services.AddRazorComponents()
|
|
||||||
.AddInteractiveServerComponents();
|
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|
||||||
@@ -102,9 +80,6 @@ app.UseOutputCache();
|
|||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
app.UseAntiforgery();
|
app.MapHopFrame();
|
||||||
app.MapStaticAssets();
|
|
||||||
app.MapRazorComponents<App>()
|
|
||||||
.MapHopFramePages();
|
|
||||||
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ internal sealed class ProjectRepository(DatabaseContext context) : IProjectRepos
|
|||||||
public async Task<IEnumerable<Project>> GetProjects(CancellationToken ct) {
|
public async Task<IEnumerable<Project>> GetProjects(CancellationToken ct) {
|
||||||
return await context.Projects
|
return await context.Projects
|
||||||
.Include(p => p.Languages)
|
.Include(p => p.Languages)
|
||||||
|
.OrderByDescending(p => p.OrderIndex)
|
||||||
.ToArrayAsync(ct);
|
.ToArrayAsync(ct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<IsAspireHost>true</IsAspireHost>
|
<IsAspireHost>true</IsAspireHost>
|
||||||
@@ -12,9 +12,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Aspire.Hosting.AppHost" Version="9.0.0"/>
|
<PackageReference Include="Aspire.Hosting.AppHost" Version="13.0.2" />
|
||||||
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="9.0.0" />
|
<PackageReference Include="Aspire.Hosting.PostgreSQL" Version="13.0.2" />
|
||||||
<PackageReference Include="Aspire.Hosting.Redis" Version="9.0.0" />
|
<PackageReference Include="Aspire.Hosting.Redis" Version="13.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
|
<FrameworkReference Include="Microsoft.AspNetCore.App"/>
|
||||||
|
|
||||||
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="9.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="10.1.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="9.0.0"/>
|
<PackageReference Include="Microsoft.Extensions.ServiceDiscovery" Version="10.1.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0"/>
|
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0"/>
|
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0"/>
|
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0"/>
|
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
|
||||||
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0"/>
|
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
|
||||||
USER $APP_UID
|
USER $APP_UID
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
EXPOSE 8081
|
EXPOSE 8081
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
|
|||||||
@@ -10,6 +10,6 @@ internal sealed class ProjectRepository(IHttpClientFactory factory) : IProjectRe
|
|||||||
if (!response.IsSuccessStatusCode) return [];
|
if (!response.IsSuccessStatusCode) return [];
|
||||||
|
|
||||||
var data = await response.Content.ReadFromJsonAsync<IEnumerable<Project>>(ct);
|
var data = await response.Content.ReadFromJsonAsync<IEnumerable<Project>>(ct);
|
||||||
return data ?? [];
|
return data?.OrderByDescending(p => p.OrderIndex) ?? Enumerable.Empty<Project>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user