1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-25 17:59:24 +01:00
MLEM/Jenkinsfile
2020-05-21 01:54:27 +02:00

53 lines
1.3 KiB
Groovy

pipeline {
agent any
stages {
stage('Build Projects') {
steps {
sh '''for i in **/MLEM*.csproj; do
dotnet build $i
done'''
sh 'dotnet build **/Demos.csproj'
}
}
stage('Pack and Publish (Master)') {
when {
branch 'master'
}
steps {
sh 'find . -type f -name \'*.nupkg\' -delete'
sh '''for i in **/MLEM*.csproj; do
dotnet pack $i --version-suffix ${BUILD_NUMBER}
done'''
sh '''for i in **/*.nupkg; do
dotnet nuget push -s http://localhost:5000/v3/index.json $i -k $BAGET -n true
done'''
}
sh '''docfx.exe "Docs/docfx.json"
cp Docs/_site /var/www/MLEM/Docs/_site'''
}
}
stage('Pack and Publish (Release)') {
when {
branch 'release'
}
steps {
sh 'find . -type f -name \'*.nupkg\' -delete'
sh '''for i in **/MLEM*.csproj; do
dotnet pack $i
done'''
sh '''for i in **/*.nupkg; do
dotnet nuget push -s https://api.nuget.org/v3/index.json $i -k $NUGET -n true
done'''
sh '''docfx.exe "Docs/docfx.json"
cp Docs/_site /var/www/MLEM/Docs/_site'''
}
}
}
environment {
BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676')
NUGET = credentials('e1bf7f6c-6047-4f7e-b639-15240a8f8351')
}
}