From 972a147fb9a247ac21d71e75dc7b352d39045f17 Mon Sep 17 00:00:00 2001 From: "Daniel J. Summers" Date: Mon, 18 Jul 2022 21:57:33 -0400 Subject: [PATCH] Create initial project --- src/.dockerignore | 25 ++++++++++++ src/Dockerfile | 23 +++++++++++ src/RethinkDb.Driver.FSharp.Tests/Program.fs | 1 + .../RethinkDb.Driver.FSharp.Tests.fsproj | 39 +++++++++++++++++++ src/RethinkDb.Driver.FSharp.Tests/Tests.fs | 17 ++++++++ src/RethinkDb.Driver.FSharp.Tests/Types.fs | 16 ++++++++ src/RethinkDb.Driver.FSharp.sln | 14 +++++++ 7 files changed, 135 insertions(+) create mode 100644 src/.dockerignore create mode 100644 src/Dockerfile create mode 100644 src/RethinkDb.Driver.FSharp.Tests/Program.fs create mode 100644 src/RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj create mode 100644 src/RethinkDb.Driver.FSharp.Tests/Tests.fs create mode 100644 src/RethinkDb.Driver.FSharp.Tests/Types.fs diff --git a/src/.dockerignore b/src/.dockerignore new file mode 100644 index 0000000..cd967fc --- /dev/null +++ b/src/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md \ No newline at end of file diff --git a/src/Dockerfile b/src/Dockerfile new file mode 100644 index 0000000..7a51ae2 --- /dev/null +++ b/src/Dockerfile @@ -0,0 +1,23 @@ +FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +WORKDIR /src +COPY ["RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj", "RethinkDb.Driver.FSharp.Tests/"] +RUN dotnet restore "RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj" +COPY . . +WORKDIR "/src/RethinkDb.Driver.FSharp.Tests" +RUN dotnet build "RethinkDb.Driver.FSharp.Tests.fsproj" -c Release -o /app/build + +FROM build AS publish +RUN dotnet publish "RethinkDb.Driver.FSharp.Tests.fsproj" -c Release -r linux-x64 --self-contained true -o /app/publish + +FROM rethinkdb:latest AS test +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["RethinkDb.Driver.FSharp.Tests"] + +# FROM base AS final +# WORKDIR /app +# COPY --from=publish /app/publish . +# ENTRYPOINT ["dotnet", "RethinkDb.Driver.FSharp.Tests.dll"] diff --git a/src/RethinkDb.Driver.FSharp.Tests/Program.fs b/src/RethinkDb.Driver.FSharp.Tests/Program.fs new file mode 100644 index 0000000..0695f84 --- /dev/null +++ b/src/RethinkDb.Driver.FSharp.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/src/RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj b/src/RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj new file mode 100644 index 0000000..a1bd658 --- /dev/null +++ b/src/RethinkDb.Driver.FSharp.Tests/RethinkDb.Driver.FSharp.Tests.fsproj @@ -0,0 +1,39 @@ + + + + net6.0 + + false + false + Linux + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + + diff --git a/src/RethinkDb.Driver.FSharp.Tests/Tests.fs b/src/RethinkDb.Driver.FSharp.Tests/Tests.fs new file mode 100644 index 0000000..e8a6601 --- /dev/null +++ b/src/RethinkDb.Driver.FSharp.Tests/Tests.fs @@ -0,0 +1,17 @@ +module Tests + +open System +open RethinkDb.Driver +open RethinkDb.Driver.FSharp.Functions +open Types +open Xunit + +let private r = RethinkDB.R + +[] +let ``My test`` () = + Assert.True(true) + +let ``dbCreate succeeds`` () = + dbCreate "fsharp_driver_test" + |> runWrite \ No newline at end of file diff --git a/src/RethinkDb.Driver.FSharp.Tests/Types.fs b/src/RethinkDb.Driver.FSharp.Tests/Types.fs new file mode 100644 index 0000000..725b80e --- /dev/null +++ b/src/RethinkDb.Driver.FSharp.Tests/Types.fs @@ -0,0 +1,16 @@ +module Types + +/// A simple type to use for testing +type BasicType = + { // The ID for this record + id : string + + /// A field with a boolean value + boolField : bool + + /// A field with an integer value + intField : int + + /// A field with a string value + stringField : string + } diff --git a/src/RethinkDb.Driver.FSharp.sln b/src/RethinkDb.Driver.FSharp.sln index 691e7de..bcb5da5 100644 --- a/src/RethinkDb.Driver.FSharp.sln +++ b/src/RethinkDb.Driver.FSharp.sln @@ -4,6 +4,8 @@ VisualStudioVersion = 17.1.32228.430 MinimumVisualStudioVersion = 15.0.26124.0 Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "RethinkDb.Driver.FSharp", "RethinkDb.Driver.FSharp\RethinkDb.Driver.FSharp.fsproj", "{9026E009-55DC-454E-87B7-39B9CBAD8BF8}" EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "RethinkDb.Driver.FSharp.Tests", "RethinkDb.Driver.FSharp.Tests\RethinkDb.Driver.FSharp.Tests.fsproj", "{FC062B8C-81D5-4E0A-B3BA-A84541298BDB}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -26,6 +28,18 @@ Global {9026E009-55DC-454E-87B7-39B9CBAD8BF8}.Release|x64.Build.0 = Release|Any CPU {9026E009-55DC-454E-87B7-39B9CBAD8BF8}.Release|x86.ActiveCfg = Release|Any CPU {9026E009-55DC-454E-87B7-39B9CBAD8BF8}.Release|x86.Build.0 = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|x64.ActiveCfg = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|x64.Build.0 = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|x86.ActiveCfg = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Debug|x86.Build.0 = Debug|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|Any CPU.Build.0 = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|x64.ActiveCfg = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|x64.Build.0 = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|x86.ActiveCfg = Release|Any CPU + {FC062B8C-81D5-4E0A-B3BA-A84541298BDB}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE