2020-02-17 17:24:13 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
|
|
|
stage('Build Projects') {
|
|
|
|
steps {
|
2020-02-17 17:29:42 +01:00
|
|
|
sh '''for i in **/MLEM*.csproj; do
|
|
|
|
dotnet build $i
|
|
|
|
done'''
|
2020-02-17 17:24:13 +01:00
|
|
|
sh 'dotnet build **/Demos.csproj'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-11 03:22:35 +02:00
|
|
|
stage('Pack and Publish (Master)') {
|
2020-04-11 03:21:55 +02:00
|
|
|
when {
|
|
|
|
branch 'master'
|
|
|
|
}
|
2020-02-21 13:41:33 +01:00
|
|
|
steps {
|
2020-02-21 13:50:41 +01:00
|
|
|
sh 'find . -type f -name \'*.nupkg\' -delete'
|
2020-02-21 13:41:33 +01:00
|
|
|
sh '''for i in **/MLEM*.csproj; do
|
|
|
|
dotnet pack $i --version-suffix ${BUILD_NUMBER}
|
2020-04-11 03:21:55 +02:00
|
|
|
done'''
|
|
|
|
sh '''for i in **/*.nupkg; do
|
|
|
|
dotnet nuget push -s http://localhost:5000/v3/index.json $i -k $BAGET -n true
|
2020-02-21 13:41:33 +01:00
|
|
|
done'''
|
|
|
|
}
|
2020-05-21 01:54:27 +02:00
|
|
|
sh '''docfx.exe "Docs/docfx.json"
|
|
|
|
cp Docs/_site /var/www/MLEM/Docs/_site'''
|
|
|
|
}
|
2020-02-21 13:41:33 +01:00
|
|
|
}
|
2020-04-11 03:21:55 +02:00
|
|
|
|
2020-04-11 03:22:35 +02:00
|
|
|
stage('Pack and Publish (Release)') {
|
2020-03-05 00:41:29 +01:00
|
|
|
when {
|
2020-04-11 03:21:55 +02:00
|
|
|
branch 'release'
|
2020-03-05 00:41:29 +01:00
|
|
|
}
|
2020-02-21 13:41:33 +01:00
|
|
|
steps {
|
2020-04-11 03:21:55 +02:00
|
|
|
sh 'find . -type f -name \'*.nupkg\' -delete'
|
|
|
|
sh '''for i in **/MLEM*.csproj; do
|
|
|
|
dotnet pack $i
|
|
|
|
done'''
|
2020-02-21 13:41:33 +01:00
|
|
|
sh '''for i in **/*.nupkg; do
|
2020-04-11 03:21:55 +02:00
|
|
|
dotnet nuget push -s https://api.nuget.org/v3/index.json $i -k $NUGET -n true
|
2020-02-21 13:41:33 +01:00
|
|
|
done'''
|
2020-05-21 01:54:27 +02:00
|
|
|
sh '''docfx.exe "Docs/docfx.json"
|
|
|
|
cp Docs/_site /var/www/MLEM/Docs/_site'''
|
2020-02-21 13:41:33 +01:00
|
|
|
}
|
|
|
|
|
2020-02-17 17:24:13 +01:00
|
|
|
}
|
2020-02-26 10:26:22 +01:00
|
|
|
environment {
|
|
|
|
BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676')
|
2020-04-11 03:21:55 +02:00
|
|
|
NUGET = credentials('e1bf7f6c-6047-4f7e-b639-15240a8f8351')
|
2020-02-26 10:26:22 +01:00
|
|
|
}
|
2020-03-05 00:41:29 +01:00
|
|
|
}
|