Skip to content

Commit

Permalink
ASP.NET Core 5.0 Migration (#355)
Browse files Browse the repository at this point in the history
This is the overall migration from full framework to ASP.NET Core 6.0.

Co-authored-by: Nick Craver <nrcraver@gmail.com>
Co-authored-by: Ben Macpherson <33694220+benjimac93@users.noreply.github.com>
Co-authored-by: mgravell <marc.gravell@gmail.com>
Co-authored-by: Dean Ward <dward@stackoverflow.com>
Co-authored-by: Dean Ward <dean.ward@bakedbean.org.uk>
Co-authored-by: Richard Hubley <rich_hubley@hotmail.com>
Co-authored-by: Aaron Bertrand <5168570+AaronBertrand@users.noreply.github.com>
  • Loading branch information
7 people committed Mar 10, 2022
1 parent ed57f51 commit a47b1fc
Show file tree
Hide file tree
Showing 774 changed files with 15,593 additions and 26,500 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
@@ -0,0 +1,15 @@
[Oo]bj/
[Bb]in/
.vs/
TestResults/
artifacts/
_ReSharper.*/
_ReSharper.*
*.user
*.suo
*.cache
*.psess
*.vsp
*.pidb
*.userprefs
*DS_Store
34 changes: 34 additions & 0 deletions .editorconfig
@@ -1,3 +1,4 @@
# Suppress: EC112
# editorconfig.org
root = true

Expand Down Expand Up @@ -89,3 +90,36 @@ csharp_new_line_before_members_in_anonymous_types = true

# Space settings
csharp_space_after_keywords_in_control_flow_statements = true:suggestion

# Naming
dotnet_naming_rule.private_members_with_underscore.symbols = private_fields
dotnet_naming_rule.private_members_with_underscore.style = prefix_underscore
dotnet_naming_rule.private_members_with_underscore.severity = silent

dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
dotnet_naming_symbols.constant_fields.required_modifiers = const

dotnet_naming_style.prefix_underscore.capitalization = camel_case
dotnet_naming_style.prefix_underscore.required_prefix = _

# CA1027: Mark enums with FlagsAttribute
dotnet_diagnostic.CA1027.severity = none

# CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = none

# CA1034: Nested types should not be visible
dotnet_diagnostic.CA1034.severity = none

# CA1063: Implement IDisposable Correctly
dotnet_diagnostic.CA1063.severity = none

# CA1810: Initialize reference type static fields inline
dotnet_diagnostic.CA1810.severity = none

# CA1819: Properties should not return arrays
dotnet_diagnostic.CA1819.severity = none

# CA1822: Mark members as static
dotnet_diagnostic.CA1822.severity = none
24 changes: 24 additions & 0 deletions .filenesting.json
@@ -0,0 +1,24 @@
{
"help": "https://go.microsoft.com/fwlink/?linkid=866610",
"root": true,

"dependentFileProviders": {
"add": {
"pathSegment": {
"add": {
"ExtensionMethods.*": [ ".cs" ],
"Models\\*.*": [ "*.cs" ]
}
},
"fileSuffixToExtension": {
"add": {
".Model.cs": [ ".cshtml" ],
".json.defaults": [ ".json" ],
".min.css": [ ".css" ],
".min.js": [ ".js" ],
".min.js.map": [ ".min.js" ]
}
}
}
}
}
15 changes: 15 additions & 0 deletions .github/workflows/docker.yml
@@ -0,0 +1,15 @@
name: Docker Image CI

on:
push:
paths:
- 'Dockerfile'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build Opserver Docker Image
run: |
docker build --tag opserver/opserver-ci:latest --target web .
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,15 @@
name: CI Build

on: [push]

jobs:
build:
runs-on: windows-2019
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- uses: actions/checkout@v1
- name: Build with dotnet
run: dotnet build
23 changes: 15 additions & 8 deletions .gitignore
Expand Up @@ -76,10 +76,6 @@ Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf

#############
## Windows detritus
#############
Expand All @@ -99,7 +95,18 @@ $RECYCLE.BIN/

.hg
.hgignore
Opserver/config/*.json
!Opserver/config/*.example.json
Opserver/config/*.config
*.StackOverflow.*
src/Opserver/config/*.json
!src/Opserver/config/*.example.json
src/Opserver/config/*.config
src/Opserver.Web/config/*.json
!src/Opserver.Web/config/*.example.json
src/Opserver.Web/config/*.config
*.StackOverflow.*
src/Opserver.Web/localSettings.json
.idea/*
src/Opserver.Web/wwwroot/Content/js/plugins.js
src/Opserver.Web/wwwroot/Content/js/plugins.min.js
src/Opserver.Web/wwwroot/Content/js/bundle*
#src/Opserver.Web/wwwroot/Content/themes/*.css
docs/_site/*
docs/Gemfile.lock
4 changes: 0 additions & 4 deletions Build.bat

This file was deleted.

28 changes: 28 additions & 0 deletions Dockerfile
@@ -0,0 +1,28 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /app

# Global
COPY ./*.sln ./nuget.config ./
# Apps
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
# Tests
COPY tests/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/${file%.*}/; done

# Copy all
COPY . .

# FROM build AS test-runner
# WORKDIR /app/tests/Opserver.Tests
# ENTRYPOINT dotnet test --results-directory /app/artifacts --logger:trx

FROM build AS web-publish
WORKDIR /app/src/Opserver.Web
RUN dotnet publish -c Release -o publish

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS web
WORKDIR /app
COPY --from=web-publish /app/src/Opserver.Web/publish ./
ENTRYPOINT ["dotnet", "Opserver.Web.dll"]
File renamed without changes.
12 changes: 0 additions & 12 deletions Opserver.Core/Current.Cache.cs

This file was deleted.

65 changes: 0 additions & 65 deletions Opserver.Core/Current.cs

This file was deleted.

44 changes: 0 additions & 44 deletions Opserver.Core/Data/CloudFlare/CloudFlareAPI.Actions.cs

This file was deleted.

59 changes: 0 additions & 59 deletions Opserver.Core/Data/CloudFlare/CloudFlareAPI.Zones.cs

This file was deleted.

0 comments on commit a47b1fc

Please sign in to comment.