Began moving rpoject to a devcontainer
Some checks failed
ydeng/props/pipeline/head There was a failure building this commit

This commit is contained in:
Harrison Deng 2024-07-17 21:43:46 +00:00
parent 641389e79d
commit 94e3a5759c
8 changed files with 59 additions and 20 deletions

View File

@ -0,0 +1,19 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
"name": "Debian",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:bullseye"
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

4
.gitignore vendored
View File

@ -1,5 +1,3 @@
# Created by https://www.toptal.com/developers/gitignore/api/aspnetcore,visualstudiocode,dotnetcore,python,database,node # Created by https://www.toptal.com/developers/gitignore/api/aspnetcore,visualstudiocode,dotnetcore,python,database,node
# Edit at https://www.toptal.com/developers/gitignore?templates=aspnetcore,visualstudiocode,dotnetcore,python,database,node # Edit at https://www.toptal.com/developers/gitignore?templates=aspnetcore,visualstudiocode,dotnetcore,python,database,node
@ -576,4 +574,4 @@ cython_debug/
# Props # Props
shop-data shop-data
Props/shops Props/shops

47
Jenkinsfile vendored
View File

@ -1,28 +1,45 @@
pipeline { pipeline {
agent any
stages { stages {
stage("Install") { stage("Install") {
steps { steps {
sh 'wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"' sh '''#!/bin/bash
sh 'bash Miniforge3.sh -b -p "${HOME}/conda"' # Installing .NET environment
sh 'echo "conda activate props" >> ~/.bashrc' # According to https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#examples
sh 'node --version && npm --version' # and https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install
sh 'cd Props && npm install' curl -L -o- https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 8.0
sh 'dotnet restore Props.Shop/Props.Shop.sln' echo \'export DOTNET_ROOT=$HOME/.dotnet\' >> ~/.profile
sh 'dotnet restore Props.Tests' echo \'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools\' >> ~/.profile
# Installing Node Version Manager
# According to https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
'''
sh '''#!/bin/bash
source ~/.profile
nvm install 20.15.1
nvm use default
# Restore all projects
dotnet restore Props/Props.csproj
dotnet restore Props.Tests/Props.Tests.csproj
dotnet restore Props.Shop/Props.Shop.sln
npm install --prefix ./Props
'''
} }
} }
stage("Props.Shop") { stage("Props.Shop") {
stages { stages {
stage("Test") { stage("Test") {
steps { steps {
sh 'dotnet test --logger xunit --no-restore Props.Shop/Props.Shop.sln' sh '''#!/bin/bash
dotnet test --logger xunit --no-restore Props.Shop/Props.Shop.sln
'''
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Shop/*.Tests/TestResults/*.xml', stopProcessingIfError: true)]) xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Shop/*.Tests/TestResults/*.xml', stopProcessingIfError: true)])
} }
} }
stage("Publish") { stage("Publish") {
steps { steps {
sh 'dotnet publish --configuration Release --output output/shop-modules Props.Shop/Props.Shop.sln' sh '''#!/bin/bash
dotnet publish --configuration Release --output output/shop-modules Props.Shop/Props.Shop.sln
'''
fingerprint 'output/shop-modules/**/Props.Shop.*' fingerprint 'output/shop-modules/**/Props.Shop.*'
sh "python3 scripts/load_shop_modules.py" sh "python3 scripts/load_shop_modules.py"
} }
@ -33,14 +50,18 @@ pipeline {
stages { stages {
stage("Test") { stage("Test") {
steps { steps {
sh 'dotnet test --logger xunit --no-restore Props.Tests' sh '''#!/bin/bash
dotnet test --logger xunit --no-restore Props.Tests
'''
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Tests/TestResults/*.xml', stopProcessingIfError: true)]) xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Tests/TestResults/*.xml', stopProcessingIfError: true)])
} }
} }
stage("Publish") { stage("Publish") {
steps { steps {
sh 'dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-x64 --self-contained Props' sh '''#!/bin/bash
sh 'dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props' dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-x64 --self-contained Props
dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props
'''
fingerprint 'output/props/**/Props*' fingerprint 'output/props/**/Props*'
tar file: "output/props-linux-x64.tar.gz", archive: true, compress: true, dir: "output/props/props-linux-x64" tar file: "output/props-linux-x64.tar.gz", archive: true, compress: true, dir: "output/props/props-linux-x64"
zip zipFile: "output/props-win-x64.zip", archive: true, dir: "output/props/props-win-x64" zip zipFile: "output/props-win-x64.zip", archive: true, dir: "output/props/props-win-x64"

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<InvariantGlobalization>true</InvariantGlobalization>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -2,6 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<InvariantGlobalization>true</InvariantGlobalization>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>

View File

@ -8,7 +8,7 @@
<SelfContained>true</SelfContained> <SelfContained>true</SelfContained>
<PublishTrimmed>false</PublishTrimmed> <PublishTrimmed>false</PublishTrimmed>
<PublishReadyToRun>true</PublishReadyToRun> <PublishReadyToRun>true</PublishReadyToRun>
<!-- <IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract> --> <InvariantGlobalization>true</InvariantGlobalization>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract> <IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<UserSecretsId>aspnet-Props-20A2A991-EC61-4C06-91D2-953482026A7B</UserSecretsId> <UserSecretsId>aspnet-Props-20A2A991-EC61-4C06-91D2-953482026A7B</UserSecretsId>
</PropertyGroup> </PropertyGroup>

View File

@ -1,3 +1,3 @@
# Props # Props
Props is a community driven website meant to help with organizing your online component shopping experience. Create project component lists, search across multiple commonly used online retail stores and share your projects with rest of the community! Props is a community driven website meant to help with organizing your online component shopping experience. Create project component lists, search across multiple commonly used online retail stores and share your projects with rest of the community!