Compare commits

..
5 Commits
Author SHA1 Message Date
jakub 8dce8108d8 Update .drone.yml
continuous-integration/drone/push Build is failing
2025-05-21 11:13:45 +00:00
jakub ac2a1f0c6e Update Dockerfile 2025-05-21 11:11:41 +00:00
jakub be33dfc338 Add Dockerfile 2025-05-21 11:09:12 +00:00
jakub 4f0e67da74 Update drone.yml 2025-05-21 11:08:30 +00:00
jakub 330315f7f2 Add drone.ci 2025-05-21 11:07:17 +00:00
12 changed files with 26 additions and 149 deletions
+21 -15
View File
@@ -3,23 +3,29 @@ type: docker
name: default
steps:
- name: docker-build-and-push
- name: build
image: mcr.microsoft.com/dotnet/sdk:8.0
commands:
- dotnet publish -c Release -o out
- name: docker-build
image: plugins/docker
settings:
repo: git.internet-master.cz/jakub/dotnettest
repo: registry.example.com/myblazorapp
tags: latest
registry: git.internet-master.cz
dockerfile: Dockerfile
username:
from_secret: gitea_docker_username
password:
from_secret: gitea_docker_password
username: your_registry_username
password: your_registry_password
- name: call-portainer-webhook
image: curlimages/curl
commands:
- curl -X POST http://192.168.52.21:9000/api/webhooks/18e7c408-4e70-4ad3-8fe8-de6a3b577894
trigger:
branch:
- main
- name: deploy
image: appleboy/drone-ssh
settings:
host: your-server.cz
username: deploy_user
key:
from_secret: ssh_private_key
script:
- docker pull registry.example.com/myblazorapp:latest
- docker stop myblazorapp || true
- docker rm myblazorapp || true
- docker run -d --name myblazorapp -p 8080:80 registry.example.com/myblazorapp:latest
+5 -16
View File
@@ -1,21 +1,10 @@
#test
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /repo
# Dockerfile tčest
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . .
RUN ls -l /repo
RUN ls -l /repo/MyBlazorApp
WORKDIR /repo/MyBlazorApp
RUN dotnet publish MyBlazorApp.csproj -c Release -o /app/publish
RUN dotnet publish -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "MyBlazorApp.dll"]
ENTRYPOINT ["dotnet", "MyBlazorApp.dll"]
-17
View File
@@ -1,17 +0,0 @@
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Authorization
<CascadingAuthenticationState>
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
</CascadingAuthenticationState>
-7
View File
@@ -1,7 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
-3
View File
@@ -1,3 +0,0 @@
@page "/"
<h1>Hello, Blazor world! This is triggered by the new runner</h1>
-23
View File
@@ -1,23 +0,0 @@
@page "/"
@namespace MyBlazorApp.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Hello Blazor</title>
<base href="~/" />
</head>
<body>
<app>
<component type="typeof(App)" render-mode="ServerPrerendered" />
</app>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
-22
View File
@@ -1,22 +0,0 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapBlazorHub();
app.MapFallbackToPage("/_Host");
app.Run();
-7
View File
@@ -1,7 +0,0 @@
@inherits LayoutComponentBase
<div class="page">
<main>
@Body
</main>
</div>
-4
View File
@@ -1,4 +0,0 @@
@using MyBlazorApp
@using Microsoft.AspNetCore.Components
@using Microsoft.AspNetCore.Components.Web
@using MyBlazorApp.Shared
-4
View File
@@ -1,4 +0,0 @@
@page "/"
<h1>Hello, world!</h1>
Welcome to your new Blazor app. Testing new runner
-24
View File
@@ -1,24 +0,0 @@
@page "/"
@namespace MyBlazorApp.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyBlazorApp</title>
<base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link href="css/site.css" rel="stylesheet" />
</head>
<body>
<app>
<component type="typeof(App)" render-mode="ServerPrerendered" />
</app>
<script src="_framework/blazor.server.js"></script>
</body>
</html>
-7
View File
@@ -1,7 +0,0 @@
@inherits LayoutComponentBase
<div class="page">
<main>
@Body
</main>
</div>