diff --git a/Jenkinsfile b/Jenkinsfile index 4d85f48..b8b9dfd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,12 +12,12 @@ pipeline { echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc # Installing Node Version Manager - # According to https://github.com/Schniz/fnm - curl -fsSL https://fnm.vercel.app/install | bash + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + ''' sh '''#!/bin/bash - fnm install 20.15.1 - fnm use default + nvm install 20.15.1 + nvm use default # Restore all projects dotnet restore Props/Props.csproj dotnet restore Props.Tests/Props.Tests.csproj diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100644 index 0000000..982666a --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,21 @@ +#!/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_SYSTEM_GLOBALIZATION_INVARIANT=1 >> ~/.bashrc +echo 'export DOTNET_ROOT=$HOME/.dotnet' >> ~/.bashrc +echo 'export PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools' >> ~/.bashrc +# Installing Node Version Manager +# According to https://github.com/Schniz/fnm +curl -fsSL https://fnm.vercel.app/install | bash +''' +sh '''#!/bin/bash +fnm install 20.15.1 +fnm 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 \ No newline at end of file diff --git a/scripts/publish_props.sh b/scripts/publish_props.sh new file mode 100644 index 0000000..2dbefbc --- /dev/null +++ b/scripts/publish_props.sh @@ -0,0 +1,3 @@ +#!/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 \ No newline at end of file diff --git a/scripts/publish_props_shops.sh b/scripts/publish_props_shops.sh new file mode 100644 index 0000000..80fe099 --- /dev/null +++ b/scripts/publish_props_shops.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +dotnet publish --configuration Release --output output/shop-modules Props.Shop/Props.Shop.sln \ No newline at end of file diff --git a/scripts/test_props.sh b/scripts/test_props.sh new file mode 100644 index 0000000..5ba79cb --- /dev/null +++ b/scripts/test_props.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +dotnet test --logger xunit --no-restore Props.Tests \ No newline at end of file diff --git a/scripts/test_props_shops.sh b/scripts/test_props_shops.sh new file mode 100644 index 0000000..c24d051 --- /dev/null +++ b/scripts/test_props_shops.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +dotnet test --logger xunit --no-restore Props.Shop/Props.Shop.sln \ No newline at end of file