Permalink
Browse files

847 update dotnet core services (#848)

* updated api service

* update publishing to 2.1

* attempt to fix circle tests

* fix Kestrel request line size
  • Loading branch information...
Yshayy committed Jul 1, 2018
1 parent 820af55 commit eeb80e56d99132bed5e855ef701031b214d395ad
Showing with 126 additions and 167 deletions.
  1. +1 −1 .circleci/config.yml
  2. +1 −0 .gitignore
  3. +22 −0 .vscode/launch.json
  4. +6 −2 TweekApiDockerfile
  5. +1 −1 TweekApiSmokeTestDockerfile
  6. +3 −8 ...rivers.Context.Couchbase.IntegrationTests/Tweek.Drivers.Context.Couchbase.IntegrationTests.csproj
  7. +1 −1 addons/Context/Tweek.Drivers.Context.Couchbase/Tweek.Drivers.Context.Couchbase.csproj
  8. +3 −8 ...ek.Drivers.Context.MongoDb.IntegrationTests/Tweek.Drivers.Context.MongoDb.IntegrationTests.csproj
  9. +2 −2 addons/Context/Tweek.Drivers.Context.MongoDb/Tweek.Drivers.Context.MongoDb.csproj
  10. +3 −8 .../Tweek.Drivers.Context.Redis.IntegrationTests/Tweek.Drivers.Context.Redis.IntegrationTests.csproj
  11. +4 −4 addons/Rules/Tweek.Drivers.Rules.Management/Tweek.Drivers.Rules.Management.csproj
  12. +3 −3 addons/Rules/Tweek.Drivers.Rules.Minio/Tweek.Drivers.Rules.Minio.csproj
  13. +1 −1 core/Engine/Tweek.Engine.Core/Tweek.Engine.Core.csproj
  14. +9 −9 core/Engine/Tweek.Engine.Core/Utils/TraceHelpers.cs
  15. +3 −3 core/Engine/Tweek.Engine.Drivers/Tweek.Engine.Drivers.csproj
  16. +5 −5 core/Engine/Tweek.Engine.Tests/Tweek.Engine.Tests.csproj
  17. +1 −1 core/Engine/Tweek.Engine/Tweek.Engine.csproj
  18. +1 −1 core/JPad/Tweek.JPad.Utils/Tweek.JPad.Utils.csproj
  19. +5 −5 core/Tweek.ApiService.Addons/Tweek.ApiService.Addons.csproj
  20. +4 −4 services/api/Tweek.ApiService.SmokeTests/Tweek.ApiService.SmokeTests.csproj
  21. +3 −3 services/api/Tweek.ApiService.Tests/Tweek.ApiService.Tests.csproj
  22. +3 −3 services/api/Tweek.ApiService/Program.cs
  23. +9 −15 services/api/Tweek.ApiService/Tweek.ApiService.csproj
  24. +0 −23 services/api/Tweek.ApiService/web.config
  25. +2 −2 services/publishing/Dockerfile
  26. +3 −2 services/publishing/Tweek.Publishing.Service/Startup.cs
  27. +1 −27 services/publishing/Tweek.Publishing.Service/Sync/RepoSynchronizer.cs
  28. +1 −1 services/publishing/Tweek.Publishing.Service/Sync/SyncActor.cs
  29. +12 −15 services/publishing/Tweek.Publishing.Service/Tweek.Publishing.Service.csproj
  30. +8 −0 services/publishing/Tweek.Publishing.Service/Utils/ShellHelper.cs
  31. +5 −9 services/publishing/Tweek.Publishing.Tests/Tweek.Publishing.Tests.csproj
@@ -2,7 +2,7 @@ version: 2
jobs:
build:
docker:
- image: microsoft/dotnet:2.0.0-sdk
- image: microsoft/dotnet:2.1-sdk
environment:
- DOTNET_CLI_TELEMETRY_OUTPUT=1
- image: redis:alpine
@@ -106,6 +106,7 @@ _TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover
coverage

# NCrunch
_NCrunch_*
@@ -73,6 +73,28 @@
"quoteArgs": false,
"debuggerPath": "/vsdbg/vsdbg"
}
},
{
"name": "Attach API",

"type": "coreclr",
"logging": {

},
"request": "attach",
"processName": "dotnet",
"sourceFileMap": {
"/app": "${workspaceRoot}/services/api/Tweek.ApiService"
},
"pipeTransport": {
"pipeProgram": "docker",
"pipeCwd": "${workspaceRoot}",
"pipeArgs": [
"run --rm -i --pid=container:dev_api_1 yshay/vsdbg"
],
"quoteArgs": false,
"debuggerPath": "/vsdbg"
}
}
]
}
@@ -4,7 +4,7 @@ COPY . /src
RUN find /src -type f -not -name "*.csproj" -delete && find /src -type d -empty -delete

# ---- BUILD & TEST ----
FROM microsoft/aspnetcore-build:2.0.0 as source
FROM microsoft/dotnet:2.1-sdk as source

WORKDIR /src
COPY --from=csproj-files /src .
@@ -17,9 +17,13 @@ RUN dotnet build Tweek.sln -c Release && \
dotnet publish ./services/api/Tweek.ApiService/Tweek.ApiService.csproj -c Release -o ./obj/Docker/publish

# ---- RELEASE ----
FROM microsoft/aspnetcore:2.0.0 as release
FROM microsoft/dotnet:2.1-aspnetcore-runtime as release
WORKDIR /app
EXPOSE 80

### ---- DEBUG ----
### RUN if [ $target = "Debug" ]; then apt-get update && apt-get install unzip && rm -rf /var/lib/apt/lists/* && curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg; fi

COPY --from=source /src/services/api/Tweek.ApiService/obj/Docker/publish .
HEALTHCHECK --interval=15s --timeout=15s --retries=8 \
CMD curl -f http://localhost/health || exit 1
@@ -1,4 +1,4 @@
FROM microsoft/aspnetcore-build:2.0.0
FROM microsoft/dotnet:2.1-sdk as source

RUN apt-get update && \
apt-get install -y --no-install-recommends jq && \
@@ -1,22 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tweek.Drivers.ContextIntegrationTests\Tweek.Drivers.ContextIntegrationTests.csproj" />
<ProjectReference Include="..\Tweek.Drivers.Context.Couchbase\Tweek.Drivers.Context.Couchbase.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
</Project>
@@ -11,7 +11,7 @@
<NuspecFile>$([System.IO.Path]::Combine($(MSBuildProjectDirectory),$(MSBuildProjectName))).nuspec</NuspecFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CouchbaseNetClient" Version="2.5.10" />
<PackageReference Include="CouchbaseNetClient" Version="2.5.12" />
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="System.Collections.Immutable" version="1.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" version="2.0.0" />
@@ -1,22 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tweek.Drivers.Context.MongoDb\Tweek.Drivers.Context.MongoDb.csproj" />
<ProjectReference Include="..\Tweek.Drivers.ContextIntegrationTests\Tweek.Drivers.ContextIntegrationTests.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
</Project>
@@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
<PackageReference Include="MongoDB.Driver" Version="2.5.0" />
<PackageReference Include="MongoDB.Driver" Version="2.6.1" />
<PackageReference Include="System.Collections.Immutable" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Tweek.ApiService.Addons\Tweek.ApiService.Addons.csproj" />
@@ -1,22 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Tweek.Drivers.Context.Redis\Tweek.Drivers.Context.Redis.csproj" />
<ProjectReference Include="..\Tweek.Drivers.ContextIntegrationTests\Tweek.Drivers.ContextIntegrationTests.csproj" />
</ItemGroup>

<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
</ItemGroup>

</Project>
</Project>
@@ -2,11 +2,11 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Engine\Tweek.Engine.Drivers\Tweek.Engine.Drivers.csproj" />
<ProjectReference Include="..\..\..\core\Tweek.ApiService.Addons\Tweek.ApiService.Addons.csproj" />
</ItemGroup>
</Project>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
</Project>
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Minio.NetCore" Version="1.0.2" />
<PackageReference Include="Minio.NetCore" Version="1.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\Engine\Tweek.Engine.Drivers\Tweek.Engine.Drivers.csproj" />
@@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="LanguageExt.Core" Version="2.1.21" />
<PackageReference Include="LanguageExt.Core" Version="3.0.17" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Tweek.Engine.DataTypes\Tweek.Engine.DataTypes.csproj" />
@@ -1,26 +1,26 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Reactive.Disposables;

namespace Tweek.Engine.Core.Utils
{
public class Disposable: IDisposable {
private readonly Action _cleanup;
public Disposable(Action cleanup) => _cleanup = cleanup;
public void Dispose() => _cleanup();
public static IDisposable Create(Action cleanup) => new Disposable(cleanup);
}

public static class TraceHelpers
{
public static ConcurrentBag<string> c = new ConcurrentBag<string>();
public static void Flush()
{
foreach (var item in c)
{
//Trace.TraceInformation(item);
}
}

public static IDisposable TraceTime(string message)
{
var guid = Guid.NewGuid();
c.Add($"{guid}::{message}::start");
var sw = Stopwatch.StartNew();
return Disposable.Create(() =>
return Disposable.Create(() =>
{
sw.Stop();
c.Add($"{guid}::{message}::end::{sw.ElapsedMilliseconds}");
@@ -8,8 +8,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageReference Include="NATS.Client" Version="0.8.0" />
<PackageReference Include="System.Reactive" Version="3.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" />
<PackageReference Include="NATS.Client" Version="0.8.1" />
<PackageReference Include="System.Reactive" Version="4.0.0" />
</ItemGroup>
</Project>
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<NoWarn>1591, 1701, 1702, 1998</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="LanguageExt.Core" Version="2.1.21" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="3.1.1" />
<PackageReference Include="Moq" Version="4.7.142" />
<PackageReference Include="LanguageExt.Core" Version="3.0.17" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.0.0" />
<PackageReference Include="Moq" Version="4.8.3" />
<PackageReference Include="Tweek.JPad" Version="0.6.28" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
@@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="LanguageExt.Core" Version="2.1.21" />
<PackageReference Include="LanguageExt.Core" Version="3.0.17" />
<PackageReference Include="Soluto.Collections.RadixTree" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
@@ -3,7 +3,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="LanguageExt.Core" Version="2.1.21" />
<PackageReference Include="LanguageExt.Core" Version="3.0.17" />
<PackageReference Include="Tweek.JPad" Version="0.6.28" />
</ItemGroup>
<ItemGroup>
@@ -13,11 +13,11 @@
<ItemGroup>
<PackageReference Include="App.Metrics" Version="1.3.0" />
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Engine\Tweek.Engine.Drivers\Tweek.Engine.Drivers.csproj" />
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharpUtils.Newtonsoft.JsonValue" Version="0.2.6" />
<PackageReference Include="LanguageExt.Core" Version="2.1.21" />
<PackageReference Include="RestEase" Version="1.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="LanguageExt.Core" Version="3.0.17" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="RestEase" Version="1.4.5" />
<PackageReference Include="Tweek.JPad" Version="0.6.28" />
<PackageReference Include="xunit" Version="2.2.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<TargetFramework>netcoreapp2.1</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="4.5.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="FakeItEasy" Version="4.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Serilog;
using System.IO;

@@ -8,9 +9,8 @@ public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
var host = WebHost.CreateDefaultBuilder(args)
.UseKestrel(opts=> opts.Limits.MaxRequestLineSize = 128 * 1024)
.UseContentRoot(Directory.GetCurrentDirectory())
.UseStartup<Startup>()
.UseSerilog()
.Build();
Oops, something went wrong.

0 comments on commit eeb80e5

Please sign in to comment.