Refactored repo organization. Added Jenkinsfile.
This commit is contained in:
parent
44e072a723
commit
9cc55e516d
50
Jenkinsfile
vendored
Normal file
50
Jenkinsfile
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
pipeline {
|
||||
agent any
|
||||
stages {
|
||||
stage("Props.Shop") {
|
||||
stages {
|
||||
stage("Restore") {
|
||||
steps {
|
||||
dotnetRestore project: "Props.Shop/Props.Shop.sln"
|
||||
dotnetRestore project: "Props.Shop/Props.Shop.Tests.sln"
|
||||
}
|
||||
}
|
||||
stage("Test") {
|
||||
steps {
|
||||
dotnetTest project: "Props.Shop/Props.Shop.Tests.sln"
|
||||
}
|
||||
}
|
||||
stage("Publish") {
|
||||
steps {
|
||||
dotnetPublish configuration: 'Release', project: 'Props.Shop/Props.Shop.sln', selfContained: false, unstableIfWarnings: true
|
||||
}
|
||||
}
|
||||
stage("Load") {
|
||||
steps {
|
||||
sh "python3 scripts/load_shop_modules.py"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage("Props") {
|
||||
stages {
|
||||
stage("Restore") {
|
||||
steps {
|
||||
dotnetRestore project: "Props"
|
||||
dotnetRestore project: "Props.Tests"
|
||||
}
|
||||
}
|
||||
stage("Test") {
|
||||
steps {
|
||||
dotnetTest project: "Props.Tests"
|
||||
}
|
||||
}
|
||||
stage("Publish") {
|
||||
steps {
|
||||
dotnetPublish configuration: 'Release', project: 'Props', selfContained: false, unstableIfWarnings: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
27
Props-Modules/.vscode/launch.json
vendored
27
Props-Modules/.vscode/launch.json
vendored
@ -1,27 +0,0 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
// Use IntelliSense to find out which attributes exist for C# debugging
|
||||
// Use hover for the description of the existing attributes
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"name": ".NET Core Launch (console)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/test/Props.Shop/Adafruit.Tests/bin/Debug/net6.0/Props.Shop.Adafruit.Tests.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/test/Props.Shop/Adafruit.Tests",
|
||||
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
|
||||
"console": "internalConsole",
|
||||
"stopAtEntry": false
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
42
Props-Modules/.vscode/tasks.json
vendored
42
Props-Modules/.vscode/tasks.json
vendored
@ -1,42 +0,0 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "build",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/test/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "publish",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/test/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
},
|
||||
{
|
||||
"label": "watch",
|
||||
"command": "dotnet",
|
||||
"type": "process",
|
||||
"args": [
|
||||
"watch",
|
||||
"run",
|
||||
"${workspaceFolder}/test/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
]
|
||||
}
|
@ -23,7 +23,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Props.Shop\Adafruit\Props.Shop.Adafruit.csproj" />
|
||||
<ProjectReference Include="..\Adafruit\Props.Shop.Adafruit.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
22
Props.Shop/Props.Shop.Tests.sln
Normal file
22
Props.Shop/Props.Shop.Tests.sln
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Props.Shop.Adafruit.Tests", "Adafruit.Tests\Props.Shop.Adafruit.Tests.csproj", "{DDE31868-2F4E-43D1-9955-E1B4C1BB13A0}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DDE31868-2F4E-43D1-9955-E1B4C1BB13A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DDE31868-2F4E-43D1-9955-E1B4C1BB13A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DDE31868-2F4E-43D1-9955-E1B4C1BB13A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DDE31868-2F4E-43D1-9955-E1B4C1BB13A0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
28
Props.Shop/Props.Shop.sln
Normal file
28
Props.Shop/Props.Shop.sln
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Props.Shop.Adafruit", "Adafruit\Props.Shop.Adafruit.csproj", "{9C8E4646-C49E-422E-9884-A49D4A05998C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Props.Shop.Framework", "Framework\Props.Shop.Framework.csproj", "{2ED74B8A-F8A7-4DA0-B8E9-AE97207AB20A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{9C8E4646-C49E-422E-9884-A49D4A05998C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9C8E4646-C49E-422E-9884-A49D4A05998C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9C8E4646-C49E-422E-9884-A49D4A05998C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9C8E4646-C49E-422E-9884-A49D4A05998C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{2ED74B8A-F8A7-4DA0-B8E9-AE97207AB20A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2ED74B8A-F8A7-4DA0-B8E9-AE97207AB20A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2ED74B8A-F8A7-4DA0-B8E9-AE97207AB20A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2ED74B8A-F8A7-4DA0-B8E9-AE97207AB20A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
23
Props.Tests/Props.Tests.csproj
Normal file
23
Props.Tests/Props.Tests.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
12
Props.Tests/UnitTest1.cs
Normal file
12
Props.Tests/UnitTest1.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Xunit;
|
||||
|
||||
namespace Props.Tests;
|
||||
|
||||
public class UnitTest1
|
||||
{
|
||||
[Fact]
|
||||
public void Test1()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
@if (!string.IsNullOrEmpty((ViewData["Specific"] as string)))
|
||||
{
|
||||
@* Adds page specific scripts semi-automatically. *@
|
||||
<script defer src="@($"~/js/specific/{(ViewData["Specific"])}.js")" asp-append-version="true"></script>
|
||||
}
|
||||
</head>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<!-- https://docs.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props for more information. -->
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<UserSecretsId>aspnet-Props-20A2A991-EC61-4C06-91D2-953482026A7B</UserSecretsId>
|
||||
@ -43,7 +43,7 @@
|
||||
</Exec>
|
||||
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
|
||||
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
|
||||
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
|
||||
<Exec WorkingDirectory="./" Command="npm install" />
|
||||
</Target>
|
||||
|
||||
<!-- Build static resources -->
|
||||
|
@ -1,11 +1,10 @@
|
||||
{
|
||||
"private": true,
|
||||
"main": "js/index.js",
|
||||
"scripts": {
|
||||
"build": "webpack --config webpack.prod.js",
|
||||
"build:dev": "webpack --config webpack.dev.js",
|
||||
"build:prod": "webpack --config webpack.prod.js",
|
||||
"postinstall": "python ../scripts/npm_post_install.py"
|
||||
"postinstall": "python3 ../scripts/clear_webpack_cache.py"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
|
@ -10,5 +10,5 @@ def clear():
|
||||
shutil.rmtree(CACHE_DIR, ignore_errors=True)
|
||||
|
||||
|
||||
if __name__ == "main":
|
||||
if __name__ == "__main__":
|
||||
clear()
|
26
scripts/load_shop_modules.py
Normal file
26
scripts/load_shop_modules.py
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
from glob import glob
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
PROP_SHOP_MODULES_DIR = "Props.Shop"
|
||||
PROPS_SHOP_MODULES_DST = "Props/shops"
|
||||
NET_VER = "net6.0"
|
||||
|
||||
SHOP_MODULE_GLOB = "**/bin/Release/{net_ver}/publish/*.{ext}"
|
||||
EXTS = ["deps.json", "dll"]
|
||||
|
||||
|
||||
def load():
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.chdir("..")
|
||||
os.chdir(PROP_SHOP_MODULES_DIR)
|
||||
for ext in EXTS:
|
||||
results = glob(SHOP_MODULE_GLOB.format(net_ver=NET_VER, ext=ext))
|
||||
for result in results:
|
||||
shutil.copy(result, PROPS_SHOP_MODULES_DST)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
load()
|
@ -1,3 +0,0 @@
|
||||
import utils.clear_webpack_cache as clear_webpack_cache
|
||||
|
||||
clear_webpack_cache.clear() # Refer to https://webpack.js.org/guides/build-performance/#persistent-cache and https://webpack.js.org/blog/2020-10-10-webpack-5-release/#persistent-caching
|
@ -1 +0,0 @@
|
||||
|
Loading…
Reference in New Issue
Block a user