diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..009a80f --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -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" +} diff --git a/.gitignore b/.gitignore index 41aacd2..da2be5f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ - - # 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 @@ -576,4 +574,4 @@ cython_debug/ # Props shop-data -Props/shops \ No newline at end of file +Props/shops diff --git a/Jenkinsfile b/Jenkinsfile index c5fc663..19f3b8f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,28 +1,45 @@ pipeline { - agent any stages { stage("Install") { steps { - sh 'wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"' - sh 'bash Miniforge3.sh -b -p "${HOME}/conda"' - sh 'echo "conda activate props" >> ~/.bashrc' - sh 'node --version && npm --version' - sh 'cd Props && npm install' - sh 'dotnet restore Props.Shop/Props.Shop.sln' - sh 'dotnet restore Props.Tests' + sh '''#!/bin/bash + # Installing .NET environment + # According to https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#examples + # and https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install + curl -L -o- https://dot.net/v1/dotnet-install.sh | bash -s -- --channel 8.0 + echo \'export DOTNET_ROOT=$HOME/.dotnet\' >> ~/.profile + 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") { stages { stage("Test") { 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)]) } } stage("Publish") { 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.*' sh "python3 scripts/load_shop_modules.py" } @@ -33,14 +50,18 @@ pipeline { stages { stage("Test") { 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)]) } } stage("Publish") { steps { - sh 'dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-x64 --self-contained Props' - sh 'dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props' + sh '''#!/bin/bash + 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*' 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" diff --git a/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj b/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj index 1546936..a66a3ad 100644 --- a/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj +++ b/Props.Shop/Adafruit.Tests/Props.Shop.Adafruit.Tests.csproj @@ -2,7 +2,7 @@ net7.0 - + true false diff --git a/Props.Shop/Adafruit/Props.Shop.Adafruit.csproj b/Props.Shop/Adafruit/Props.Shop.Adafruit.csproj index 6bb2bdb..3fb1711 100644 --- a/Props.Shop/Adafruit/Props.Shop.Adafruit.csproj +++ b/Props.Shop/Adafruit/Props.Shop.Adafruit.csproj @@ -2,6 +2,7 @@ net7.0 + true diff --git a/Props.Tests/Props.Tests.csproj b/Props.Tests/Props.Tests.csproj index 0e9952c..1496729 100644 --- a/Props.Tests/Props.Tests.csproj +++ b/Props.Tests/Props.Tests.csproj @@ -3,7 +3,7 @@ net7.0 enable - + true false diff --git a/Props/Props.csproj b/Props/Props.csproj index f99c99c..081e2bb 100644 --- a/Props/Props.csproj +++ b/Props/Props.csproj @@ -8,7 +8,7 @@ true false true - + true true aspnet-Props-20A2A991-EC61-4C06-91D2-953482026A7B diff --git a/README.md b/README.md index 74c3280..d94f838 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # 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! \ No newline at end of file +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!