feature: initial commit
This commit is contained in:
73
.build/Build.fs
Normal file
73
.build/Build.fs
Normal file
@@ -0,0 +1,73 @@
|
||||
open Fake.Core
|
||||
open Fake.IO
|
||||
open Farmer
|
||||
open Farmer.Builders
|
||||
|
||||
open Helpers
|
||||
|
||||
initializeContext()
|
||||
|
||||
let srcPath = Path.getFullName "src"
|
||||
let testPath = Path.getFullName "test"
|
||||
let libPath = None
|
||||
|
||||
let deployPath = Path.getFullName "deploy"
|
||||
let packPath = Path.getFullName "packages"
|
||||
let versionFile = Path.getFullName ".version"
|
||||
|
||||
Target.create "Clean" (fun _ -> Shell.cleanDir deployPath)
|
||||
|
||||
Target.create "InstallClient" (fun _ ->
|
||||
run npm "install" "."
|
||||
run dotnet "tool restore" "."
|
||||
)
|
||||
|
||||
Target.create "Bundle" (fun _ ->
|
||||
run dotnet $"publish -c Release -o \"{deployPath}\"" srcPath
|
||||
)
|
||||
|
||||
Target.create "BundleDebug" (fun _ ->
|
||||
run dotnet $"publish -c Debug -o \"{deployPath}\"" srcPath
|
||||
)
|
||||
|
||||
Target.create "Pack" (fun _ ->
|
||||
match libPath with
|
||||
| Some p -> run dotnet $"pack -c Release -o \"{packPath}\"" p
|
||||
| None -> ()
|
||||
)
|
||||
|
||||
Target.create "Run" (fun _ -> run dotnet "watch run" srcPath)
|
||||
|
||||
Target.create "Format" (fun _ ->
|
||||
run dotnet "fantomas . -r" "src"
|
||||
)
|
||||
|
||||
Target.create "Test" (fun _ ->
|
||||
if System.IO.Directory.Exists testPath then
|
||||
run dotnet "run" testPath
|
||||
else ()
|
||||
)
|
||||
|
||||
open Fake.Core.TargetOperators
|
||||
|
||||
let dependencies = [
|
||||
"Clean"
|
||||
==> "InstallClient"
|
||||
==> "Bundle"
|
||||
|
||||
"Clean"
|
||||
==> "BundleDebug"
|
||||
|
||||
"Clean"
|
||||
==> "Test"
|
||||
|
||||
"Clean"
|
||||
==> "InstallClient"
|
||||
==> "Run"
|
||||
|
||||
"Clean"
|
||||
==> "Pack"
|
||||
]
|
||||
|
||||
[<EntryPoint>]
|
||||
let main args = runOrDefault args
|
||||
105
.build/Helpers.fs
Normal file
105
.build/Helpers.fs
Normal file
@@ -0,0 +1,105 @@
|
||||
module Helpers
|
||||
|
||||
open Fake.Core
|
||||
|
||||
let initializeContext () =
|
||||
let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ]
|
||||
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
|
||||
|
||||
module Proc =
|
||||
module Parallel =
|
||||
open System
|
||||
|
||||
let locker = obj()
|
||||
|
||||
let colors =
|
||||
[| ConsoleColor.Blue
|
||||
ConsoleColor.Yellow
|
||||
ConsoleColor.Magenta
|
||||
ConsoleColor.Cyan
|
||||
ConsoleColor.DarkBlue
|
||||
ConsoleColor.DarkYellow
|
||||
ConsoleColor.DarkMagenta
|
||||
ConsoleColor.DarkCyan |]
|
||||
|
||||
let print color (colored: string) (line: string) =
|
||||
lock locker
|
||||
(fun () ->
|
||||
let currentColor = Console.ForegroundColor
|
||||
Console.ForegroundColor <- color
|
||||
Console.Write colored
|
||||
Console.ForegroundColor <- currentColor
|
||||
Console.WriteLine line)
|
||||
|
||||
let onStdout index name (line: string) =
|
||||
let color = colors.[index % colors.Length]
|
||||
if isNull line then
|
||||
print color $"{name}: --- END ---" ""
|
||||
else if String.isNotNullOrEmpty line then
|
||||
print color $"{name}: " line
|
||||
|
||||
let onStderr name (line: string) =
|
||||
let color = ConsoleColor.Red
|
||||
if isNull line |> not then
|
||||
print color $"{name}: " line
|
||||
|
||||
let redirect (index, (name, createProcess)) =
|
||||
createProcess
|
||||
|> CreateProcess.redirectOutputIfNotRedirected
|
||||
|> CreateProcess.withOutputEvents (onStdout index name) (onStderr name)
|
||||
|
||||
let printStarting indexed =
|
||||
for (index, (name, c: CreateProcess<_>)) in indexed do
|
||||
let color = colors.[index % colors.Length]
|
||||
let wd =
|
||||
c.WorkingDirectory
|
||||
|> Option.defaultValue ""
|
||||
let exe = c.Command.Executable
|
||||
let args = c.Command.Arguments.ToStartInfo
|
||||
print color $"{name}: {wd}> {exe} {args}" ""
|
||||
|
||||
let run cs =
|
||||
cs
|
||||
|> Seq.toArray
|
||||
|> Array.indexed
|
||||
|> fun x -> printStarting x; x
|
||||
|> Array.map redirect
|
||||
|> Array.Parallel.map Proc.run
|
||||
|
||||
let createProcess exe arg dir =
|
||||
CreateProcess.fromRawCommandLine exe arg
|
||||
|> CreateProcess.withWorkingDirectory dir
|
||||
|> CreateProcess.ensureExitCode
|
||||
|
||||
let dotnet = createProcess "dotnet"
|
||||
let npm =
|
||||
let npmPath =
|
||||
match ProcessUtils.tryFindFileOnPath "npm" with
|
||||
| Some path -> path
|
||||
| None ->
|
||||
"npm was not found in path. Please install it and make sure it's available from your path. " +
|
||||
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info"
|
||||
|> failwith
|
||||
|
||||
createProcess npmPath
|
||||
|
||||
let run proc arg dir =
|
||||
proc arg dir
|
||||
|> Proc.run
|
||||
|> ignore
|
||||
|
||||
let runParallel processes =
|
||||
processes
|
||||
|> Proc.Parallel.run
|
||||
|> ignore
|
||||
|
||||
let runOrDefault args =
|
||||
try
|
||||
match args with
|
||||
| [| target |] -> Target.runOrDefault target
|
||||
| _ ->
|
||||
Target.runOrDefault "Run"
|
||||
0
|
||||
with e ->
|
||||
printfn "%A" e
|
||||
1
|
||||
18
.config/dotnet-tools.json
Normal file
18
.config/dotnet-tools.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 1,
|
||||
"isRoot": true,
|
||||
"tools": {
|
||||
"fable": {
|
||||
"version": "3.7.0",
|
||||
"commands": [
|
||||
"fable"
|
||||
]
|
||||
},
|
||||
"fantomas-tool": {
|
||||
"version": "4.6.4",
|
||||
"commands": [
|
||||
"fantomas"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
29
.devcontainer/Dockerfile
Normal file
29
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:6.0
|
||||
|
||||
# Add keys and sources lists
|
||||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash
|
||||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" \
|
||||
| tee /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
# Install node, 7zip, yarn, git, process tools
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y nodejs p7zip-full git procps ssh-client
|
||||
|
||||
# Clean up
|
||||
RUN apt-get autoremove -y \
|
||||
&& apt-get clean -y \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dotnet tools
|
||||
RUN dotnet tool install fable -g
|
||||
|
||||
# Trouble brewing
|
||||
RUN rm /etc/ssl/openssl.cnf
|
||||
|
||||
# add dotnet tools to path to pick up fake and paket installation
|
||||
ENV PATH="/root/.dotnet/tools:${PATH}"
|
||||
|
||||
# Copy endpoint specific user settings into container to specify
|
||||
# .NET Core should be used as the runtime.
|
||||
COPY settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
|
||||
11
.devcontainer/devcontainer.json
Normal file
11
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "SAFE",
|
||||
"dockerFile": "Dockerfile",
|
||||
"appPort": [8080, 8085],
|
||||
"extensions": [
|
||||
"ionide.ionide-fsharp",
|
||||
"ms-dotnettools.csharp",
|
||||
"editorconfig.editorconfig",
|
||||
"msjsdiag.debugger-for-chrome"
|
||||
]
|
||||
}
|
||||
3
.devcontainer/settings.vscode.json
Normal file
3
.devcontainer/settings.vscode.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"FSharp.fsacRuntime":"netcore"
|
||||
}
|
||||
32
.editorconfig
Normal file
32
.editorconfig
Normal file
@@ -0,0 +1,32 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
|
||||
[*.fs]
|
||||
max_line_length=120
|
||||
# Feliz style
|
||||
fsharp_single_argument_web_mode=true
|
||||
fsharp_space_before_colon=false
|
||||
fsharp_max_if_then_else_short_width=60
|
||||
fsharp_max_infix_operator_expression=50
|
||||
fsharp_max_record_width=70
|
||||
fsharp_max_record_number_of_items=1
|
||||
fsharp_max_array_or_list_width=70
|
||||
fsharp_max_array_or_list_number_of_items=1
|
||||
fsharp_max_value_binding_width=70
|
||||
fsharp_max_function_binding_width=40
|
||||
fsharp_max_dot_get_expression_width=50
|
||||
fsharp_multiline_block_brackets_on_same_column=true
|
||||
fsharp_newline_between_type_definition_and_members=false
|
||||
fsharp_max_elmish_width=40
|
||||
fsharp_align_function_signature_to_indentation=false
|
||||
fsharp_alternative_long_member_definitions=false
|
||||
fsharp_multi_line_lambda_closing_newline=false
|
||||
fsharp_disable_elmish_syntax=false
|
||||
fsharp_keep_indent_in_branch=false
|
||||
fsharp_blank_lines_around_nested_multiline_expressions=false
|
||||
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
.fable/
|
||||
.fake/
|
||||
.vs/
|
||||
obj/
|
||||
bin/
|
||||
packages/
|
||||
node_modules/
|
||||
src/Client/public/js/
|
||||
release.cmd
|
||||
release.sh
|
||||
.idea/
|
||||
*.orig
|
||||
*.DotSettings.user
|
||||
deploy
|
||||
.ionide/
|
||||
*.db
|
||||
build.fsx.lock
|
||||
9
.gitlab-ci.yml
Normal file
9
.gitlab-ci.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
variables:
|
||||
DEPLOY_NAME: default
|
||||
DEPLOY_NAMESPACE: default
|
||||
|
||||
include:
|
||||
- project: oceanbox/gitlab-ci
|
||||
ref: main
|
||||
file: Dotnet.gitlab-ci.yml
|
||||
|
||||
41
.releaserc.yaml
Normal file
41
.releaserc.yaml
Normal file
@@ -0,0 +1,41 @@
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
- name: develop
|
||||
prerelease: true
|
||||
|
||||
plugins:
|
||||
- '@semantic-release/commit-analyzer'
|
||||
- '@semantic-release/release-notes-generator'
|
||||
- - '@semantic-release/changelog'
|
||||
- changelogFile: RELEASE_NOTES.md
|
||||
changelogTitle: "# Changelog"
|
||||
- - 'semantic-release-dotnet'
|
||||
- paths: [ "src/*.fsproj", "src/*/*.fsproj" ]
|
||||
- - '@semantic-release/exec'
|
||||
- generateNotesCmd: "echo ${nextRelease.version} > .version"
|
||||
- - '@semantic-release/git'
|
||||
- message: "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}"
|
||||
assets: [ "RELEASE_NOTES.md", ".version", "src/*.fsproj", "src/*/*.fsproj" ]
|
||||
- - '@semantic-release/gitlab'
|
||||
- assets: []
|
||||
|
||||
analyzeCommits:
|
||||
- path: "@semantic-release/commit-analyzer"
|
||||
releaseRules:
|
||||
- type: "fix"
|
||||
release: "patch"
|
||||
- type: "patch"
|
||||
release: "patch"
|
||||
- type: "feat"
|
||||
release: "minor"
|
||||
- type: "feature"
|
||||
release: "minor"
|
||||
- type: "minor"
|
||||
release: "minor"
|
||||
- type: "breaking"
|
||||
release: "major"
|
||||
- type: "major"
|
||||
release: "major"
|
||||
|
||||
|
||||
77
BatHub.sln
Normal file
77
BatHub.sln
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27004.2005
|
||||
MinimumVisualStudioVersion = 15.0.26124.0
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F06B1A0D-341E-4FC0-8128-4EEDA9C65C2C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
README.md = README.md
|
||||
LICENSE = LICENSE
|
||||
Dockerfile = Dockerfile
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Build", "Build.fsproj", "{5A21136C-ABDA-48B9-8208-45A28CDB84CC}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "src", "src/BatHub.fsproj", "{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}"
|
||||
EndProject
|
||||
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "test", "test\Tests.fsproj", "{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|x64.Build.0 = Release|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{5A21136C-ABDA-48B9-8208-45A28CDB84CC}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|x64.Build.0 = Release|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{9EBF5E9B-ED3E-4CEB-ABD4-E03F92AD45C9}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E2472750-93E4-4A7B-9DF3-A39BB5D6E8C4}.Release|x86.Build.0 = Release|Any CPU
|
||||
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {62184F5D-AF21-400B-81D8-AE8AF46BB3BE}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
16
Build.fsproj
Normal file
16
Build.fsproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include=".build/Helpers.fs" />
|
||||
<Compile Include=".build/Build.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fake.Core.Target" Version="5.20.4" />
|
||||
<PackageReference Include="Fake.DotNet.Cli" Version="5.20.4" />
|
||||
<PackageReference Include="Fake.IO.FileSystem" Version="5.20.4" />
|
||||
<PackageReference Include="Farmer" Version="1.6.26" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM mcr.microsoft.com/dotnet/dotnet:6.0
|
||||
RUN rm /etc/ssl/openssl.cnf
|
||||
|
||||
COPY deploy/ /app
|
||||
|
||||
WORKDIR /app
|
||||
CMD /app/BatHub
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Serit Tromsø AS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# BatHub
|
||||
|
||||
## Run
|
||||
|
||||
`dotnet run`
|
||||
|
||||
## Build
|
||||
|
||||
`dotnet run Bundle`
|
||||
1
RELEASE_NOTES.md
Normal file
1
RELEASE_NOTES.md
Normal file
@@ -0,0 +1 @@
|
||||
# Changelog
|
||||
22
helm/.helmignore
Normal file
22
helm/.helmignore
Normal file
@@ -0,0 +1,22 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
21
helm/Chart.yaml
Normal file
21
helm/Chart.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
apiVersion: v2
|
||||
name: bat-hub
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
version: 0.2.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application.
|
||||
appVersion: 1.10.0
|
||||
4
helm/base/kustomization.yaml
Normal file
4
helm/base/kustomization.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- base.yaml
|
||||
3
helm/production/appsettings.json
Normal file
3
helm/production/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ConnString" : "Data Source=/data/data.db"
|
||||
}
|
||||
25
helm/production/ingress_patch.yaml
Normal file
25
helm/production/ingress_patch.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
- op: test
|
||||
path: /spec/rules/0/http/paths/0/path
|
||||
value: /
|
||||
|
||||
# - op: replace
|
||||
# path: /spec/rules/0/http/paths/0/path
|
||||
# value:
|
||||
# path: /app
|
||||
|
||||
# - op: add
|
||||
# path: /spec/rules/-
|
||||
# value:
|
||||
# host: BatHub.k1.itpartner.no
|
||||
# http:
|
||||
# paths:
|
||||
# - path: /
|
||||
# pathType: Prefix
|
||||
# backend:
|
||||
# service:
|
||||
# name: <name>
|
||||
# port:
|
||||
# number: 80
|
||||
# - op: add
|
||||
# path: /spec/tls/0/hosts/-
|
||||
# value: BatHub.k1.itpartner.no
|
||||
15
helm/production/kustomization.yaml
Normal file
15
helm/production/kustomization.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
secretGenerator:
|
||||
- name: <deploy_name>
|
||||
files:
|
||||
- appsettings.json
|
||||
generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
patchesJson6902:
|
||||
- target:
|
||||
group: networking.k8s.io
|
||||
version: v1
|
||||
kind: Ingress
|
||||
name: <deploy_name>
|
||||
path: ingress_patch.yaml
|
||||
bases:
|
||||
- ../base
|
||||
5
helm/production/overlays.yaml
Normal file
5
helm/production/overlays.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
ingress:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production
|
||||
nginx.ingress.kubernetes.io/whitelist-source-range: 0.0.0.0/0
|
||||
|
||||
3
helm/staging/appsettings.json
Normal file
3
helm/staging/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"ConnString" : "Data Source=/data/data.db"
|
||||
}
|
||||
25
helm/staging/ingress_patch.yaml
Normal file
25
helm/staging/ingress_patch.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
- op: test
|
||||
path: /spec/rules/0/http/paths/0/path
|
||||
value: /
|
||||
|
||||
# - op: replace
|
||||
# path: /spec/rules/0/http/paths/0/path
|
||||
# value:
|
||||
# path: /app
|
||||
|
||||
# - op: add
|
||||
# path: /spec/rules/-
|
||||
# value:
|
||||
# host: BatHub.k1.itpartner.no
|
||||
# http:
|
||||
# paths:
|
||||
# - path: /
|
||||
# pathType: Prefix
|
||||
# backend:
|
||||
# service:
|
||||
# name: <name>
|
||||
# port:
|
||||
# number: 80
|
||||
# - op: add
|
||||
# path: /spec/tls/0/hosts/-
|
||||
# value: BatHub.k1.itpartner.no
|
||||
15
helm/staging/kustomization.yaml
Normal file
15
helm/staging/kustomization.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
secretGenerator:
|
||||
- name: <deploy_name>
|
||||
files:
|
||||
- appsettings.json
|
||||
generatorOptions:
|
||||
disableNameSuffixHash: true
|
||||
patchesJson6902:
|
||||
- target:
|
||||
group: networking.k8s.io
|
||||
version: v1
|
||||
kind: Ingress
|
||||
name: <deploy_name>
|
||||
path: ingress_patch.yaml
|
||||
bases:
|
||||
- ../base
|
||||
4
helm/staging/overlays.yaml
Normal file
4
helm/staging/overlays.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
ingress:
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: letsencrypt-production
|
||||
nginx.ingress.kubernetes.io/whitelist-source-range: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
||||
21
helm/templates/NOTES.txt
Normal file
21
helm/templates/NOTES.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
1. Get the application URL by running these commands:
|
||||
{{- if .Values.ingress.enabled }}
|
||||
{{- range $host := .Values.ingress.hosts }}
|
||||
{{- range .paths }}
|
||||
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else if contains "NodePort" .Values.service.type }}
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "BatHub.fullname" . }})
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
echo http://$NODE_IP:$NODE_PORT
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "BatHub.fullname" . }}'
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "BatHub.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "BatHub.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
|
||||
{{- end }}
|
||||
65
helm/templates/_helpers.tpl
Normal file
65
helm/templates/_helpers.tpl
Normal file
@@ -0,0 +1,65 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "BatHub.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "BatHub.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "BatHub.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "BatHub.labels" -}}
|
||||
helm.sh/chart: {{ include "BatHub.chart" . }}
|
||||
{{ include "BatHub.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "BatHub.selectorLabels" -}}
|
||||
app: {{ include "BatHub.name" . }}
|
||||
instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/name: {{ include "BatHub.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "BatHub.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "BatHub.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
119
helm/templates/deployment.yaml
Normal file
119
helm/templates/deployment.yaml
Normal file
@@ -0,0 +1,119 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "BatHub.fullname" . }}
|
||||
annotations:
|
||||
{{- if .Values.ci.environment }}
|
||||
app.gitlab.com/env: {{ default "" .Values.ci.environment }}
|
||||
app.gitlab.com/app: {{ default "" .Values.ci.projectPath }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "BatHub.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "BatHub.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{{- if .Values.ci.environment }}
|
||||
app.gitlab.com/env: {{ default "" .Values.ci.environment }}
|
||||
app.gitlab.com/app: {{ default "" .Values.ci.projectPath }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "BatHub.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "BatHub.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8085
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
{{- if .Values.service.https }}
|
||||
scheme: HTTPS
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
{{- if .Values.service.https }}
|
||||
scheme: HTTPS
|
||||
{{- end }}
|
||||
{{- if .Values.service.https }}
|
||||
env:
|
||||
- name: ASPNETCORE_Kestrel__Certificates__Default__Path
|
||||
value: "/app/tls/kestrel.pfx"
|
||||
- name: SERVER_USE_HTTPS
|
||||
value: "1"
|
||||
{{- else }}
|
||||
env: []
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: appsettings
|
||||
mountPath: /app/appsettings.json
|
||||
subPath: appsettings.json
|
||||
readOnly: true
|
||||
{{- if .Values.service.https }}
|
||||
- name: tls-certificates
|
||||
mountPath: /app/tls
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
initContainers:
|
||||
- name: init
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
command: [ "/bin/sh", "-c", "true"]
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /data
|
||||
- name: appsettings
|
||||
mountPath: /app/appsettings.json
|
||||
subPath: appsettings.json
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: data
|
||||
{{- if .Values.persistence.enabled }}
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim | default (include "BatHub.fullname" .) }}
|
||||
{{- else }}
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
- name: appsettings
|
||||
secret:
|
||||
secretName: {{ template "BatHub.fullname" . }}
|
||||
{{- if .Values.service.https }}
|
||||
- name: tls-certificates
|
||||
secret:
|
||||
secretName: {{ .Values.service.secretName }}
|
||||
{{- end }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
64
helm/templates/ingress.yaml
Normal file
64
helm/templates/ingress.yaml
Normal file
@@ -0,0 +1,64 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $fullName := include "BatHub.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ $fullName }}
|
||||
labels:
|
||||
{{- include "BatHub.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
nginx.ingress.kubernetes.io/ssl-redirect: "true"
|
||||
{{- if .Values.service.https }}
|
||||
nginx.ingress.kubernetes.io/backend-protocol: HTTPS
|
||||
{{- else }}
|
||||
nginx.ingress.kubernetes.io/backend-protocol: HTTP
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
tls:
|
||||
{{- if .Values.ci.deployHost }}
|
||||
- hosts:
|
||||
- {{ .Values.ci.deployHost }}
|
||||
secretName: {{ .Release.Name }}-tls
|
||||
{{- end }}
|
||||
{{- if .Values.ingress.tls }}
|
||||
{{- range .Values.ingress.tls }}
|
||||
- hosts:
|
||||
{{- range .hosts }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
secretName: {{ .secretName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- if .Values.ci.deployHost }}
|
||||
- host: {{ .Values.ci.deployHost }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ .host | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
number: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
25
helm/templates/pvc.yaml
Normal file
25
helm/templates/pvc.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: {{ template "BatHub.fullname" . }}
|
||||
{{- with .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{ toYaml . | indent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{ include "BatHub.labels" . | indent 4 }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.persistence.accessMode | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) }}
|
||||
storageClassName: ""
|
||||
{{- else }}
|
||||
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
15
helm/templates/service.yaml
Normal file
15
helm/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "BatHub.fullname" . }}
|
||||
labels:
|
||||
{{- include "BatHub.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
{{- include "BatHub.selectorLabels" . | nindent 4 }}
|
||||
8
helm/templates/serviceaccount.yaml
Normal file
8
helm/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,8 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "BatHub.serviceAccountName" . }}
|
||||
labels:
|
||||
{{ include "BatHub.labels" . | nindent 4 }}
|
||||
{{- end -}}
|
||||
73
helm/values.yaml
Normal file
73
helm/values.yaml
Normal file
@@ -0,0 +1,73 @@
|
||||
# Default values for BatHub.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: overwritten by CD
|
||||
tag: latest
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
imagePullSecrets:
|
||||
- name: gitlab-pull-secret
|
||||
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name:
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: 2000
|
||||
|
||||
securityContext:
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
readOnlyRootFilesystem: false
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 80
|
||||
https: false
|
||||
secretName: kestrel-tls
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
|
||||
persistence:
|
||||
enabled: false
|
||||
size: 1G
|
||||
storageClass: ""
|
||||
accessMode: ReadWriteOnce
|
||||
|
||||
ci:
|
||||
environment: ""
|
||||
projectPath: ""
|
||||
deployHost: ""
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
1186
package-lock.json
generated
Normal file
1186
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
package.json
Normal file
11
package.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@semantic-release/changelog": "^6.0.1",
|
||||
"@semantic-release/exec": "^6.0.3",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"@semantic-release/gitlab": "^7.0.4",
|
||||
"semantic-release-dotnet": "^1.0.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
25
src/BatHub.fsproj
Normal file
25
src/BatHub.fsproj
Normal file
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Settings.fs" />
|
||||
<Compile Include="Main.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Argu" Version="6.1.1" />
|
||||
<PackageReference Include="FSharp.Data" Version="4.2.7" />
|
||||
<PackageReference Include="FSharpPlus" Version="1.2.2" />
|
||||
<PackageReference Include="KDTree" Version="1.4.1" />
|
||||
<PackageReference Include="MathNet.Numerics.FSharp" Version="4.15.0" />
|
||||
<PackageReference Include="ProjNet" Version="2.0.0" />
|
||||
<PackageReference Include="sdslite" Version="2.2.0" />
|
||||
<PackageReference Include="Serilog" Version="2.10.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
|
||||
<PackageReference Include="Serilog.Sinks.Seq" Version="5.1.1" />
|
||||
<PackageReference Include="Thoth.Json.Net" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
48
src/Main.fs
Normal file
48
src/Main.fs
Normal file
@@ -0,0 +1,48 @@
|
||||
module Server
|
||||
|
||||
open System
|
||||
open Serilog
|
||||
open Argu
|
||||
|
||||
open Settings
|
||||
|
||||
let configureSerilog () =
|
||||
LoggerConfiguration()
|
||||
.MinimumLevel.Information()
|
||||
.MinimumLevel.Override("Microsoft", Events.LogEventLevel.Warning)
|
||||
.MinimumLevel.Override("System", Events.LogEventLevel.Warning)
|
||||
.WriteTo.Console()
|
||||
.CreateLogger()
|
||||
|
||||
Log.Logger <- configureSerilog ()
|
||||
|
||||
type Arguments =
|
||||
| Foo
|
||||
with
|
||||
interface IArgParserTemplate with
|
||||
member this.Usage =
|
||||
match this with
|
||||
| Foo -> "run"
|
||||
|
||||
let colorizer =
|
||||
function
|
||||
| ErrorCode.HelpText -> None
|
||||
| _ -> Some ConsoleColor.Red
|
||||
|
||||
let errorHandler = ProcessExiter (colorizer = colorizer )
|
||||
|
||||
[<EntryPoint>]
|
||||
let main argv =
|
||||
let parser =
|
||||
ArgumentParser.Create<Arguments>(
|
||||
programName = "Genesis",
|
||||
errorHandler = errorHandler
|
||||
)
|
||||
let args = parser.Parse argv
|
||||
if args.Contains Foo then
|
||||
Log.Information $"{argv}"
|
||||
// let canopy =
|
||||
// args.GetResult (Foo, defaultValue = Some UI.CanopyMode.Browser)
|
||||
else
|
||||
Log.Information $"{argv}"
|
||||
0
|
||||
49
src/Settings.fs
Normal file
49
src/Settings.fs
Normal file
@@ -0,0 +1,49 @@
|
||||
module Settings
|
||||
|
||||
open System.IO
|
||||
open Thoth.Json.Net
|
||||
open Serilog
|
||||
|
||||
type Settings = {
|
||||
Setting: string
|
||||
}
|
||||
|
||||
let tryGetEnv = System.Environment.GetEnvironmentVariable >> function null | "" -> None | x -> Some x
|
||||
|
||||
let appsettings =
|
||||
let settings = System.IO.File.ReadAllText "appsettings.json"
|
||||
match Decode.Auto.fromString<Settings> settings with
|
||||
| Ok s -> s
|
||||
| Error e -> failwith e
|
||||
|
||||
// server home
|
||||
let contentRoot =
|
||||
tryGetEnv "SERVER_CONTENT_ROOT"
|
||||
|> function
|
||||
| Some root -> Path.GetFullPath root
|
||||
| None -> Path.GetFullPath "../Client"
|
||||
|
||||
// webfiles and servable assets
|
||||
let webRoot =
|
||||
tryGetEnv "SERVER_WEB_ROOT"
|
||||
|> function
|
||||
| Some root -> Path.GetFullPath root
|
||||
| None -> Path.Join [| contentRoot ; "public" |]
|
||||
|
||||
let port =
|
||||
"SERVER_PORT"
|
||||
|> tryGetEnv |> Option.map uint16 |> Option.defaultValue 8085us
|
||||
|
||||
let useSSL =
|
||||
"SERVER_USE_HTTPS"
|
||||
|> tryGetEnv |> Option.map (int >> (<) 0) |> Option.defaultValue false
|
||||
|
||||
let listenAddress =
|
||||
if useSSL then
|
||||
"https://0.0.0.0:" + port.ToString ()
|
||||
else
|
||||
"http://0.0.0.0:" + port.ToString ()
|
||||
|
||||
sprintf "Public webroot: %s" webRoot |> Log.Information
|
||||
|
||||
sprintf "AppSettings: %A" appsettings |> Log.Debug
|
||||
3
src/appsettings.json
Normal file
3
src/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"Setting" : "example setting"
|
||||
}
|
||||
421
src/packages.lock.json
Normal file
421
src/packages.lock.json
Normal file
@@ -0,0 +1,421 @@
|
||||
{
|
||||
"version": 1,
|
||||
"dependencies": {
|
||||
"net6.0": {
|
||||
"Argu": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.1.1, )",
|
||||
"resolved": "6.1.1",
|
||||
"contentHash": "5SBLYihaZ6/YNpRU+0v0QLsCk7ABmOWNOUwkXVUql2w7kJ6Hi4AFhgIv5XLTtxTid5/xrJAL+PglQkNcjANCJg==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.3.2",
|
||||
"System.Configuration.ConfigurationManager": "4.4.0"
|
||||
}
|
||||
},
|
||||
"FSharp.Core": {
|
||||
"type": "Direct",
|
||||
"requested": "[6.0.1, )",
|
||||
"resolved": "6.0.1",
|
||||
"contentHash": "VrFAiW8dEEekk+0aqlbvMNZzDvYXmgWZwAt68AUBqaWK8RnoEVUNglj66bZzhs4/U63q0EfXlhcEKnH1sTYLjw=="
|
||||
},
|
||||
"FSharp.Data": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.2.7, )",
|
||||
"resolved": "4.2.7",
|
||||
"contentHash": "gQO0u0q1z9wXOkSmL7TVQLspAGR/S2Vm3CDPStEHCcTQyivkgoZie0IsB2Zyl2inC+hmQa/jcVQNQjo7XB7Ujg==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.7.2"
|
||||
}
|
||||
},
|
||||
"FSharpPlus": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.2.2, )",
|
||||
"resolved": "1.2.2",
|
||||
"contentHash": "YzWFuAua/OCevT05FoWSInP3i6DGAwRqyJd0DtFWSisPI6LAqCMTWaj5hT4BDLDabvricVZ5VD/FWfSNubL6Gg==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.6.2"
|
||||
}
|
||||
},
|
||||
"KdTree": {
|
||||
"type": "Direct",
|
||||
"requested": "[1.4.1, )",
|
||||
"resolved": "1.4.1",
|
||||
"contentHash": "yWbb35v/V9y88SLLMUPTlAN3pQEoPhDfZf9PApFnlU4kLtwVQ75U9vW5mW4/alQnLBuLKWBKcy4W5xK95mYsuA=="
|
||||
},
|
||||
"MathNet.Numerics.FSharp": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.15.0, )",
|
||||
"resolved": "4.15.0",
|
||||
"contentHash": "PtyywucUehsUxy1YAmjciAgcHcKsRZ8jSOMT29sG2LTZ4FeaSEpfOOHh6Cm0iJn8LhOXqpAMerqJmhygg6IbSQ==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.3.3",
|
||||
"MathNet.Numerics": "4.15.0"
|
||||
}
|
||||
},
|
||||
"ProjNET": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.0.0, )",
|
||||
"resolved": "2.0.0",
|
||||
"contentHash": "iMJG8qpGJ8SjFrB044O8wgo0raAWCdG1Bvly0mmVcjzsrexDHhC+dUct6Wb1YwQtupMBjSTWq7Fn00YeNErprA==",
|
||||
"dependencies": {
|
||||
"System.Memory": "4.5.3",
|
||||
"System.Numerics.Vectors": "4.5.0"
|
||||
}
|
||||
},
|
||||
"SDSLite": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.2.0, )",
|
||||
"resolved": "2.2.0",
|
||||
"contentHash": "g4y+GyW8sAfF4b5Kwm0sTw/07rPHrtcgxqb7KzUxJsU8C7+k0GpCZwKc6Qs3wPgzKnAkdQfpP0Fa+Yrjkvxjhg==",
|
||||
"dependencies": {
|
||||
"DynamicInterop": "0.9.1"
|
||||
}
|
||||
},
|
||||
"Serilog": {
|
||||
"type": "Direct",
|
||||
"requested": "[2.10.0, )",
|
||||
"resolved": "2.10.0",
|
||||
"contentHash": "+QX0hmf37a0/OZLxM3wL7V6/ADvC1XihXN4Kq/p6d8lCPfgkRdiuhbWlMaFjR9Av0dy5F0+MBeDmDdRZN/YwQA=="
|
||||
},
|
||||
"Serilog.Sinks.Console": {
|
||||
"type": "Direct",
|
||||
"requested": "[4.0.1, )",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "apLOvSJQLlIbKlbx+Y2UDHSP05kJsV7mou+fvJoRGs/iR+jC22r8cuFVMjjfVxz/AD4B2UCltFhE1naRLXwKNw==",
|
||||
"dependencies": {
|
||||
"Serilog": "2.10.0"
|
||||
}
|
||||
},
|
||||
"Serilog.Sinks.Seq": {
|
||||
"type": "Direct",
|
||||
"requested": "[5.1.1, )",
|
||||
"resolved": "5.1.1",
|
||||
"contentHash": "+BsIoanNyZPEcWY5sVtx2nL/88UcCw9gr/l0nCfe4bjuSoFS2clDIUmKaH1UXA/hx9undHCgw4epVltOulGuxw==",
|
||||
"dependencies": {
|
||||
"Serilog": "2.10.0",
|
||||
"Serilog.Formatting.Compact": "1.1.0",
|
||||
"Serilog.Sinks.File": "4.0.0",
|
||||
"Serilog.Sinks.PeriodicBatching": "2.3.0"
|
||||
}
|
||||
},
|
||||
"Thoth.Json.Net": {
|
||||
"type": "Direct",
|
||||
"requested": "[8.0.0, )",
|
||||
"resolved": "8.0.0",
|
||||
"contentHash": "C/b+8g/xUTJTn7pbKC4bMAOy2tyolXAuHTXguT5TNzDKQ6sjnUfFa9B81fTt9PuUOdWFLyRKlXASuFhSQciJGQ==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.7.2",
|
||||
"Fable.Core": "[3.0.0, 4.0.0)",
|
||||
"Newtonsoft.Json": "11.0.2"
|
||||
}
|
||||
},
|
||||
"DynamicInterop": {
|
||||
"type": "Transitive",
|
||||
"resolved": "0.9.1",
|
||||
"contentHash": "n21+Hd+tceX8lgaOosPV+Pne+YqnZUd5RLW3OhnsVxWRzYXiAIAKmKweHIePYeY+fmcn3N5tjkJyQUccFuL3bg=="
|
||||
},
|
||||
"Fable.Core": {
|
||||
"type": "Transitive",
|
||||
"resolved": "3.0.0",
|
||||
"contentHash": "pkCOWJKAkCk36f5+q4F3XqlfsgCJL6i2lTLl4ZZVDswn8rjXo21EBG/gJ296a88LVBkI5LL2VwxQYqGZncomJw==",
|
||||
"dependencies": {
|
||||
"FSharp.Core": "4.5.2"
|
||||
}
|
||||
},
|
||||
"MathNet.Numerics": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.15.0",
|
||||
"contentHash": "cP4QgPPiU7boMyL8npvuQyVGVYUd/JQY1AWa+Wl2f//fuJN40qwt9ABRazunZIcDLHg3SSlgD/e+3Lnp69jNTg=="
|
||||
},
|
||||
"Microsoft.NETCore.Platforms": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.0.1",
|
||||
"contentHash": "2G6OjjJzwBfNOO8myRV/nFrbTw5iA+DEm0N+qUqhrOmaVtn4pC77h38I1jsXGw5VH55+dPfQsqHD0We9sCl9FQ=="
|
||||
},
|
||||
"Microsoft.NETCore.Targets": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.0.1",
|
||||
"contentHash": "rkn+fKobF/cbWfnnfBOQHKVKIOpxMZBvlSHkqDWgBpwGDcLRduvs3D9OLGeV6GWGvVwNlVi2CBbTjuPmtHvyNw=="
|
||||
},
|
||||
"Newtonsoft.Json": {
|
||||
"type": "Transitive",
|
||||
"resolved": "11.0.2",
|
||||
"contentHash": "IvJe1pj7JHEsP8B8J8DwlMEx8UInrs/x+9oVY+oCD13jpLu4JbJU2WCIsMRn5C4yW9+DgkaO8uiVE5VHKjpmdQ=="
|
||||
},
|
||||
"Serilog.Formatting.Compact": {
|
||||
"type": "Transitive",
|
||||
"resolved": "1.1.0",
|
||||
"contentHash": "pNroKVjo+rDqlxNG5PXkRLpfSCuDOBY0ri6jp9PLe505ljqwhwZz8ospy2vWhQlFu5GkIesh3FcDs4n7sWZODA==",
|
||||
"dependencies": {
|
||||
"Serilog": "2.8.0"
|
||||
}
|
||||
},
|
||||
"Serilog.Sinks.File": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.0",
|
||||
"contentHash": "vBj43RkAbeP1dzoPFR2+LfV5GevDRPDq6265JJBv223lMvT9rfdwe/S/I9ow7aZSLYKfw4qPDw6NW8YwjbDbvg==",
|
||||
"dependencies": {
|
||||
"Serilog": "2.5.0",
|
||||
"System.IO": "4.1.0",
|
||||
"System.IO.FileSystem": "4.0.1",
|
||||
"System.IO.FileSystem.Primitives": "4.0.1",
|
||||
"System.Runtime.InteropServices": "4.1.0",
|
||||
"System.Text.Encoding.Extensions": "4.0.11",
|
||||
"System.Threading": "4.0.11",
|
||||
"System.Threading.Timer": "4.0.1"
|
||||
}
|
||||
},
|
||||
"Serilog.Sinks.PeriodicBatching": {
|
||||
"type": "Transitive",
|
||||
"resolved": "2.3.0",
|
||||
"contentHash": "UYKSjTMTlUY9T3OgzMmLDLD+z0qPfgvq/RvG0rKfyz+O+Zrjw3X/Xpv14J4WMcGVsOjUaR+k8n2MdmqVpJtI6A==",
|
||||
"dependencies": {
|
||||
"Serilog": "2.0.0",
|
||||
"System.Collections.Concurrent": "4.0.12",
|
||||
"System.Threading.Timer": "4.0.1"
|
||||
}
|
||||
},
|
||||
"System.Collections": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "YUJGz6eFKqS0V//mLt25vFGrrCvOnsXjlvFQs+KimpwNxug9x0Pzy4PlFMU3Q2IzqAa9G2L4LsK3+9vCBK7oTg==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Collections.Concurrent": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.12",
|
||||
"contentHash": "2gBcbb3drMLgxlI0fBfxMA31ec6AEyYCHygGse4vxceJan8mRIWeKJ24BFzN7+bi/NFTgdIgufzb94LWO5EERQ==",
|
||||
"dependencies": {
|
||||
"System.Collections": "4.0.11",
|
||||
"System.Diagnostics.Debug": "4.0.11",
|
||||
"System.Diagnostics.Tracing": "4.1.0",
|
||||
"System.Globalization": "4.0.11",
|
||||
"System.Reflection": "4.1.0",
|
||||
"System.Resources.ResourceManager": "4.0.1",
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Runtime.Extensions": "4.1.0",
|
||||
"System.Threading": "4.0.11",
|
||||
"System.Threading.Tasks": "4.0.11"
|
||||
}
|
||||
},
|
||||
"System.Configuration.ConfigurationManager": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.4.0",
|
||||
"contentHash": "gWwQv/Ug1qWJmHCmN17nAbxJYmQBM/E94QxKLksvUiiKB1Ld3Sc/eK1lgmbSjDFxkQhVuayI/cGFZhpBSodLrg==",
|
||||
"dependencies": {
|
||||
"System.Security.Cryptography.ProtectedData": "4.4.0"
|
||||
}
|
||||
},
|
||||
"System.Diagnostics.Debug": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "w5U95fVKHY4G8ASs/K5iK3J5LY+/dLFd4vKejsnI/ZhBsWS9hQakfx3Zr7lRWKg4tAw9r4iktyvsTagWkqYCiw==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Diagnostics.Tracing": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "vDN1PoMZCkkdNjvZLql592oYJZgS7URcJzJ7bxeBgGtx5UtR5leNm49VmfHGqIffX4FKacHbI3H6UyNSHQknBg==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Globalization": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "B95h0YLEL2oSnwF/XjqSWKnwKOy/01VWkNlsCeMTFJLLabflpGV26nK164eRs5GiaRSBGpOxQ3pKoSnnyZN5pg==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.IO": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "3KlTJceQc3gnGIaHZ7UBZO26SHL1SHE4ddrmiwumFnId+CEHP+O8r386tZKaE6zlk5/mF8vifMBzHj9SaXN+mQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Text.Encoding": "4.0.11",
|
||||
"System.Threading.Tasks": "4.0.11"
|
||||
}
|
||||
},
|
||||
"System.IO.FileSystem": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "IBErlVq5jOggAD69bg1t0pJcHaDbJbWNUZTPI96fkYWzwYbN6D9wRHMULLDd9dHsl7C2YsxXL31LMfPI1SWt8w==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.IO": "4.1.0",
|
||||
"System.IO.FileSystem.Primitives": "4.0.1",
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Runtime.Handles": "4.0.1",
|
||||
"System.Text.Encoding": "4.0.11",
|
||||
"System.Threading.Tasks": "4.0.11"
|
||||
}
|
||||
},
|
||||
"System.IO.FileSystem.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "kWkKD203JJKxJeE74p8aF8y4Qc9r9WQx4C0cHzHPrY3fv/L/IhWnyCHaFJ3H1QPOH6A93whlQ2vG5nHlBDvzWQ==",
|
||||
"dependencies": {
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Memory": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.5.3",
|
||||
"contentHash": "3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA=="
|
||||
},
|
||||
"System.Numerics.Vectors": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.5.0",
|
||||
"contentHash": "QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ=="
|
||||
},
|
||||
"System.Reflection": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "JCKANJ0TI7kzoQzuwB/OoJANy1Lg338B6+JVacPl4TpUwi3cReg3nMLplMq2uqYfHFQpKIlHAUVAJlImZz/4ng==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.IO": "4.1.0",
|
||||
"System.Reflection.Primitives": "4.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Reflection.Primitives": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "4inTox4wTBaDhB7V3mPvp9XlCbeGYWVEM9/fXALd52vNEAVisc1BoVWQPuUuD0Ga//dNbA/WeMy9u9mzLxGTHQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Resources.ResourceManager": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "TxwVeUNoTgUOdQ09gfTjvW411MF+w9MBYL7AtNVc+HtBCFlutPLhUCdZjNkjbhj3bNQWMdHboF0KIWEOjJssbA==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Globalization": "4.0.11",
|
||||
"System.Reflection": "4.1.0",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "v6c/4Yaa9uWsq+JMhnOFewrYkgdNHNG2eMKuNqRn8P733rNXeRCGvV5FkkjBXn2dbVkPXOsO0xjsEeM1q2zC0g==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1"
|
||||
}
|
||||
},
|
||||
"System.Runtime.Extensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "CUOHjTT/vgP0qGW22U4/hDlOqXmcPq5YicBaXdUR2UiUoLwBT+olO6we4DVbq57jeX5uXH2uerVZhf0qGj+sVQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.Handles": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "nCJvEKguXEvk2ymk1gqj625vVnlK3/xdGzx0vOKicQkoquaTBJTP13AIYkocSUwHCLNBwUbXTqTWGDxBTWpt7g==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Runtime.InteropServices": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.1.0",
|
||||
"contentHash": "16eu3kjHS633yYdkjwShDHZLRNMKVi/s0bY8ODiqJ2RfMhDMAwxZaUaWVnZ2P71kr/or+X9o/xFWtNqz8ivieQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Reflection": "4.1.0",
|
||||
"System.Reflection.Primitives": "4.0.1",
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Runtime.Handles": "4.0.1"
|
||||
}
|
||||
},
|
||||
"System.Security.Cryptography.ProtectedData": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.4.0",
|
||||
"contentHash": "cJV7ScGW7EhatRsjehfvvYVBvtiSMKgN8bOVI0bQhnF5bU7vnHVIsH49Kva7i7GWaWYvmEzkYVk1TC+gZYBEog=="
|
||||
},
|
||||
"System.Text.Encoding": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "U3gGeMlDZXxCEiY4DwVLSacg+DFWCvoiX+JThA/rvw37Sqrku7sEFeVBBBMBnfB6FeZHsyDx85HlKL19x0HtZA==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Text.Encoding.Extensions": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "jtbiTDtvfLYgXn8PTfWI+SiBs51rrmO4AAckx4KR6vFK9Wzf6tI8kcRdsYQNwriUeQ1+CtQbM1W4cMbLXnj/OQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Text.Encoding": "4.0.11"
|
||||
}
|
||||
},
|
||||
"System.Threading": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "N+3xqIcg3VDKyjwwCGaZ9HawG9aC6cSDI+s7ROma310GQo8vilFZa86hqKppwTHleR/G0sfOzhvgnUxWCR/DrQ==",
|
||||
"dependencies": {
|
||||
"System.Runtime": "4.1.0",
|
||||
"System.Threading.Tasks": "4.0.11"
|
||||
}
|
||||
},
|
||||
"System.Threading.Tasks": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.11",
|
||||
"contentHash": "k1S4Gc6IGwtHGT8188RSeGaX86Qw/wnrgNLshJvsdNUOPP9etMmo8S07c+UlOAx4K/xLuN9ivA1bD0LVurtIxQ==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
},
|
||||
"System.Threading.Timer": {
|
||||
"type": "Transitive",
|
||||
"resolved": "4.0.1",
|
||||
"contentHash": "saGfUV8uqVW6LeURiqxcGhZ24PzuRNaUBtbhVeuUAvky1naH395A/1nY0P2bWvrw/BreRtIB/EzTDkGBpqCwEw==",
|
||||
"dependencies": {
|
||||
"Microsoft.NETCore.Platforms": "1.0.1",
|
||||
"Microsoft.NETCore.Targets": "1.0.1",
|
||||
"System.Runtime": "4.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
19
test/Tests.fs
Normal file
19
test/Tests.fs
Normal file
@@ -0,0 +1,19 @@
|
||||
module Tests
|
||||
|
||||
open Expecto
|
||||
|
||||
let server =
|
||||
testList
|
||||
"Server"
|
||||
[
|
||||
testCase "Adding valid Todo"
|
||||
<| fun _ ->
|
||||
let expectedResult = Ok()
|
||||
Expect.equal (Ok()) expectedResult "Result should be ok"
|
||||
]
|
||||
|
||||
let all =
|
||||
testList "All" [ server ]
|
||||
|
||||
[<EntryPoint>]
|
||||
let main _ = runTests defaultConfig all
|
||||
16
test/Tests.fsproj
Normal file
16
test/Tests.fsproj
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Tests.fs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\src\BatHub.fsproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Expecto" Version="9.0.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user