Files
CarbonLib/Jenkinsfile.develop
Francisco Salas bd98adc4cb
All checks were successful
FarmMaps.Develop/CarbonLib/pipeline/head This commit looks good
moved to logic from api to lib
2021-06-21 10:25:05 +02:00

42 lines
1.4 KiB
Plaintext

pipeline {
agent any
environment {
APP_VERSION_PREFIX=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/Version" -v . -n|awk -v def="1.0.0" "{print} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_NAME=sh(script: ' cat *.csproj| xmlstarlet sel -t -m "/Project/PropertyGroup/AssemblyName" -v . -n|awk -v def="App" "{print tolower(\\$0)} END { if(NR==0) {print def} }"', returnStdout: true).trim()
APP_VERSION="${APP_VERSION_PREFIX + '-prerelease.' + env.BUILD_NUMBER}"
}
stages {
stage('Dotnet Restore') {
steps {
sh '''dotnet restore CarbonLib.csproj'''
}
}
stage('Dotnet Build'){
steps {
sh '''dotnet build CarbonLib.csproj'''
}
}
stage('Dotnet Package') {
steps {
sh '''rm -rf nuget
dotnet pack -c debug -o nuget -p:PackageVersion=${APP_VERSION} CarbonLib.csproj'''
}
}
stage('Dotnet Publish') {
steps {
sh '''dotnet nuget push nuget/*.nupkg -k 0c3e3afc-935b-3db1-b023-e0d4799e674d -s https://repository.akkerweb.nl/repository/nuget-hosted/'''
}
}
}
post {
always {
emailext (
body: '${DEFAULT_CONTENT}',
mimeType: 'text/html',
replyTo: '${DEFAULT_REPLYTO}',
subject: '${DEFAULT_SUBJECT}',
to: emailextrecipients([[$class: 'CulpritsRecipientProvider'], [$class: 'RequesterRecipientProvider']])
)
}
}
}