Added sourcing of bash to shell steps in Jenkinsfile.
Some checks failed
ydeng/props/pipeline/head There was a failure building this commit

This commit is contained in:
Harrison Deng 2024-07-18 03:16:02 +00:00
parent 6fabe079a4
commit 0811fe34a0

5
Jenkinsfile vendored
View File

@ -32,6 +32,7 @@ pipeline {
stage("Test") { stage("Test") {
steps { steps {
sh '''#!/bin/bash sh '''#!/bin/bash
source ~/.profile
dotnet test --logger xunit --no-restore Props.Shop/Props.Shop.sln 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)])
@ -40,10 +41,12 @@ pipeline {
stage("Publish") { stage("Publish") {
steps { steps {
sh '''#!/bin/bash sh '''#!/bin/bash
source ~/.profile
dotnet publish --configuration Release --output output/shop-modules Props.Shop/Props.Shop.sln 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 '''#!/bin/bash sh '''#!/bin/bash
source ~/.profile
cp ./Props.Shop/output/shop-modules/**/*.dll ./Props.Shop/output/shop-modules/**/*.deps.json ./Props/shops/. cp ./Props.Shop/output/shop-modules/**/*.dll ./Props.Shop/output/shop-modules/**/*.deps.json ./Props/shops/.
''' '''
} }
@ -55,6 +58,7 @@ pipeline {
stage("Test") { stage("Test") {
steps { steps {
sh '''#!/bin/bash sh '''#!/bin/bash
source ~/.profile
dotnet test --logger xunit --no-restore Props.Tests 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)])
@ -63,6 +67,7 @@ pipeline {
stage("Publish") { stage("Publish") {
steps { steps {
sh '''#!/bin/bash sh '''#!/bin/bash
source ~/.profile
dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-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 dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props
''' '''