Compare commits
5
Commits
main
..
8dce8108d8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8dce8108d8 | ||
|
|
ac2a1f0c6e | ||
|
|
be33dfc338 | ||
|
|
4f0e67da74 | ||
|
|
330315f7f2 |
+21
-15
@@ -3,23 +3,29 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
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
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: git.internet-master.cz/jakub/dotnettest
|
repo: registry.example.com/myblazorapp
|
||||||
tags: latest
|
tags: latest
|
||||||
registry: git.internet-master.cz
|
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
username:
|
username: your_registry_username
|
||||||
from_secret: gitea_docker_username
|
password: your_registry_password
|
||||||
password:
|
|
||||||
from_secret: gitea_docker_password
|
|
||||||
|
|
||||||
- name: call-portainer-webhook
|
- name: deploy
|
||||||
image: curlimages/curl
|
image: appleboy/drone-ssh
|
||||||
commands:
|
settings:
|
||||||
- curl -X POST http://192.168.52.21:9000/api/webhooks/18e7c408-4e70-4ad3-8fe8-de6a3b577894
|
host: your-server.cz
|
||||||
|
username: deploy_user
|
||||||
trigger:
|
key:
|
||||||
branch:
|
from_secret: ssh_private_key
|
||||||
- main
|
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
@@ -1,21 +1,10 @@
|
|||||||
#test
|
# Dockerfile tčest
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
WORKDIR /repo
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN dotnet publish -c Release -o /app/publish
|
||||||
RUN ls -l /repo
|
|
||||||
RUN ls -l /repo/MyBlazorApp
|
|
||||||
|
|
||||||
WORKDIR /repo/MyBlazorApp
|
|
||||||
|
|
||||||
RUN dotnet publish MyBlazorApp.csproj -c Release -o /app/publish
|
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=build /app/publish .
|
COPY --from=build /app/publish .
|
||||||
|
ENTRYPOINT ["dotnet", "MyBlazorApp.dll"]
|
||||||
ENTRYPOINT ["dotnet", "MyBlazorApp.dll"]
|
|
||||||
@@ -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>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>net8.0</TargetFramework>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
@page "/"
|
|
||||||
|
|
||||||
<h1>Hello, Blazor world! This is triggered by the new runner</h1>
|
|
||||||
@@ -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>
|
|
||||||
|
|
||||||
@@ -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();
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
@inherits LayoutComponentBase
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<main>
|
|
||||||
@Body
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
@using MyBlazorApp
|
|
||||||
@using Microsoft.AspNetCore.Components
|
|
||||||
@using Microsoft.AspNetCore.Components.Web
|
|
||||||
@using MyBlazorApp.Shared
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
@page "/"
|
|
||||||
|
|
||||||
<h1>Hello, world!</h1>
|
|
||||||
Welcome to your new Blazor app. Testing new runner
|
|
||||||
@@ -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>
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
@inherits LayoutComponentBase
|
|
||||||
|
|
||||||
<div class="page">
|
|
||||||
<main>
|
|
||||||
@Body
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
Reference in New Issue
Block a user