Browse Source

Initial Commit

master
dan 5 years ago
parent
commit
81e1ffb300
10 changed files with 180 additions and 0 deletions
  1. +2
    -0
      Drone/Drone.Web/.dockerignore
  2. +16
    -0
      Drone/Drone.Web/Dockerfile
  3. +7
    -0
      Drone/Drone.Web/Drone.Web.csproj
  4. +26
    -0
      Drone/Drone.Web/Program.cs
  5. +28
    -0
      Drone/Drone.Web/Properties/launchSettings.json
  6. +40
    -0
      Drone/Drone.Web/Startup.cs
  7. +9
    -0
      Drone/Drone.Web/appsettings.Development.json
  8. +10
    -0
      Drone/Drone.Web/appsettings.json
  9. +25
    -0
      Drone/Drone.sln
  10. +17
    -0
      Drone/drone.yml

+ 2
- 0
Drone/Drone.Web/.dockerignore View File

@ -0,0 +1,2 @@
bin/
obj/

+ 16
- 0
Drone/Drone.Web/Dockerfile View File

@ -0,0 +1,16 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
COPY *.csproj ./
RUN dotnet restore
COPY . ./
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "Drone.Web.dll"]

+ 7
- 0
Drone/Drone.Web/Drone.Web.csproj View File

@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
</Project>

+ 26
- 0
Drone/Drone.Web/Program.cs View File

@ -0,0 +1,26 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Drone.Web
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}

+ 28
- 0
Drone/Drone.Web/Properties/launchSettings.json View File

@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:15263",
"sslPort": 44321
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Drone.Web": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

+ 40
- 0
Drone/Drone.Web/Startup.cs View File

@ -0,0 +1,40 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Drone.Web
{
public class Startup
{
// This method gets called by the runtime. Use this method to add services to the container.
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
public void ConfigureServices(IServiceCollection services)
{
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseRouting();
app.UseEndpoints(endpoints =>
{
endpoints.MapGet("/", async context =>
{
await context.Response.WriteAsync("Hello World!");
});
});
}
}
}

+ 9
- 0
Drone/Drone.Web/appsettings.Development.json View File

@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}

+ 10
- 0
Drone/Drone.Web/appsettings.json View File

@ -0,0 +1,10 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}

+ 25
- 0
Drone/Drone.sln View File

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31025.218
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Drone.Web", "Drone.Web\Drone.Web.csproj", "{9DD3B6F1-7E47-4A99-8E71-BB42A9EECF39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9DD3B6F1-7E47-4A99-8E71-BB42A9EECF39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DD3B6F1-7E47-4A99-8E71-BB42A9EECF39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DD3B6F1-7E47-4A99-8E71-BB42A9EECF39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DD3B6F1-7E47-4A99-8E71-BB42A9EECF39}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7A790878-F610-40AC-8953-18EFB7791A67}
EndGlobalSection
EndGlobal

+ 17
- 0
Drone/drone.yml View File

@ -0,0 +1,17 @@
kind: pipeline
type: docker
name: default
steps:
- name: node
image: docker
volumes:
- name: docker_sock
path: /var/run/docker.sock
commands:
- docker build --tag dronetest .
- docker rm -f dronetest || true
- docker run --name dronetest --restart always -d dronetest
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock

Loading…
Cancel
Save