| @ -0,0 +1,2 @@ | |||||
| bin/ | |||||
| obj/ | |||||
| @ -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"] | |||||
| @ -0,0 +1,7 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>net5.0</TargetFramework> | |||||
| </PropertyGroup> | |||||
| </Project> | |||||
| @ -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>(); | |||||
| }); | |||||
| } | |||||
| } | |||||
| @ -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" | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -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!"); | |||||
| }); | |||||
| }); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,9 @@ | |||||
| { | |||||
| "Logging": { | |||||
| "LogLevel": { | |||||
| "Default": "Information", | |||||
| "Microsoft": "Warning", | |||||
| "Microsoft.Hosting.Lifetime": "Information" | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,10 @@ | |||||
| { | |||||
| "Logging": { | |||||
| "LogLevel": { | |||||
| "Default": "Information", | |||||
| "Microsoft": "Warning", | |||||
| "Microsoft.Hosting.Lifetime": "Information" | |||||
| } | |||||
| }, | |||||
| "AllowedHosts": "*" | |||||
| } | |||||
| @ -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 | |||||
| @ -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 | |||||