This repository has been archived by the owner on Sep 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
177 lines (152 loc) · 11.4 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# Erweiterte Dokumentation: https://www.appveyor.com/docs/appveyor-yml/
# Version festlegen
version: 1.0.{build}
clone_folder: c:\projects\04_katafahrplanauskunft
# Branches eingrenzen
branches:
only:
- master
- develop
# Auch Pull Request erstellen
skip_branch_with_pr: false
# VM-Template für Visual Studio 2015
image: Visual Studio 2015
cache:
- '%LocalAppData%\NuGet\Cache'
- packages -> **\packages.config
- C:\miktex -> appveyor.yml
# AssemblyInfo-Dateien mit den Versionen versehen
assembly_info:
patch: true
file: AssemblyInfo.*
assembly_version: "{version}"
assembly_file_version: "{version}"
assembly_informational_version: "{version}"
platform: Any CPU
configuration: Release
matrix:
fast_finish: true
environment:
sonarqubeprefix: ""
deploymentfilename: ""
COVERALLS_REPO_TOKEN:
secure: o90DGx/Fmc85k/gMdZ3SzlyUi+a6JCg50LtSqm5zw5k2cbLaIsgKyNjORVGERs0G
SONARQUBE_TOKEN:
secure: sFo2TCruCWRcpHbTVAyLc4DZCDBxiGzRpLkv1Cq2oquDiKjo1yuCh73IN8ceKZ65
CURRENT_RELEASENOTES: ""
CODECOV_TOKEN:
secure: wq8oyQOqxMPapO/f8bB+3hnfKx1jYdExWDqK8CmZPc0aKzM6uKeNw1V1mvRM86So
before_build:
- ps: nuget restore $env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.sln -verbosity detailed
build_script:
- choco install "msbuild-sonarqube-runner" -y --force
- choco install codecov -y --force
- ps: if ($env:APPVEYOR_REPO_BRANCH -eq "develop") { $env:sonarqubeprefix = "dev-" }
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe begin /k:"04_KataFahrplanauskunft" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$($env:SONARQUBE_TOKEN)" /d:"sonar.exclusions=**/AssemblyInfo.cs" /d:"sonar.dotnet.visualstudio.testProjectPattern=*.Test" /d:sonar.cs.opencover.reportsPaths="./opencovertests.xml" /d:sonar.cs.vstest.reportsPath="$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\bin\$env:CONFIGURATION\TestResults*.trx" /v:"pr-$($env:appveyor_build_version)-#$($env:APPVEYOR_PULL_REQUEST_NUMBER)" }
- ps: if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { MSBuild.SonarQube.Runner.exe begin /k:"04_KataFahrplanauskunft" /d:"sonar.host.url=https://sonarqube.com" /d:"sonar.login=$($env:SONARQUBE_TOKEN)" /d:"sonar.exclusions=**/AssemblyInfo.cs" /d:"sonar.dotnet.visualstudio.testProjectPattern=*.Test" /d:sonar.cs.opencover.reportsPaths="./opencovertests.xml" /d:sonar.cs.vstest.reportsPath="$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\bin\$env:CONFIGURATION\TestResults*.trx" /v:"$($env:sonarqubeprefix)$($env:appveyor_build_version)" }
- ps: msbuild $env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.sln /t:Rebuild /p:RunCodeAnalysis=true
- ps: vstest.console /logger:Appveyor "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.Test\bin\$env:CONFIGURATION\Fahrplanauskunft.Test.dll"
- ps: vstest.console /logger:Appveyor "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.UI.WindowsForms.Editor.Test\bin\$env:CONFIGURATION\Fahrplanauskunft.UI.WindowsForms.Editor.Test.dll"
- ps: >-
$opencoverexe = (Resolve-Path "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\packages\OpenCover.*\tools\OpenCover.Console.exe").ToString()
& $opencoverexe -register:user -filter:"+[*]* -[*.Test*]*" -excludebyattribute:*ExcludeFromCodeCoverage* -target:vstest.console.exe "-targetargs:""$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.Test\bin\$env:CONFIGURATION\Fahrplanauskunft.Test.dll $env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.UI.WindowsForms.Editor.Test\bin\$env:CONFIGURATION\Fahrplanauskunft.UI.WindowsForms.Editor.Test.dll""" -output:./opencovertests.xml
$coveralls = (Resolve-Path "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\packages\coveralls.net.*\tools\csmacnz.Coveralls.exe").ToString()
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { & $coveralls --opencover -i ./opencovertests.xml --repoToken $env:COVERALLS_REPO_TOKEN --useRelativePaths --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_BUILD_NUMBER --pullRequest $env:APPVEYOR_PULL_REQUEST_NUMBER --serviceName appveyor }
if (-Not $env:APPVEYOR_PULL_REQUEST_NUMBER) { & $coveralls --opencover -i ./opencovertests.xml --repoToken $env:COVERALLS_REPO_TOKEN --useRelativePaths --commitId $env:APPVEYOR_REPO_COMMIT --commitBranch $env:APPVEYOR_REPO_BRANCH --commitAuthor $env:APPVEYOR_REPO_COMMIT_AUTHOR --commitEmail $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL --commitMessage $env:APPVEYOR_REPO_COMMIT_MESSAGE --jobId $env:APPVEYOR_BUILD_NUMBER --serviceName appveyor }
codecov -f ./opencovertests.xml -t $env:CODECOV_TOKEN
- ps: MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$($env:SONARQUBE_TOKEN)"
after_build:
- ps: >-
if ((Get-Command "pandoc.exe" -ErrorAction SilentlyContinue) -eq $null) { choco install pandoc -y --force } else { choco install pandoc -y }
- ps: >-
if((Test-Path "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe") -eq $false) { choco install miktex -y --force } else { choco install miktex -y }
- ps: >-
$versionString = $($env:appveyor_build_version);
$versionObject = New-Object System.Version($versionString);
$versionSearchString = "releasenotes_" + $versionObject.ToString(2).Replace(".", "_") + ".md";
$releaseNotesPath = Resolve-Path "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Projekt\ReleaseNotes\$versionSearchString";
$env:CURRENT_RELEASENOTES = Get-Content $releaseNotesPath;
- ps: if ($env:APPVEYOR_REPO_BRANCH -eq "develop") { $env:deploymentfilename = "fahrplanauskunft-$($env:appveyor_build_version)-dev.zip" }
- ps: if ($env:APPVEYOR_REPO_BRANCH -like "release*") { $env:deploymentfilename = "fahrplanauskunft-$($env:appveyor_build_version)-rc.zip" }
- ps: if ($env:APPVEYOR_REPO_BRANCH -eq "master") { $env:deploymentfilename = "fahrplanauskunft-$($env:appveyor_build_version).zip" }
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER) { $env:deploymentfilename = "fahrplanauskunft-$($env:appveyor_build_version)-dev-pr$env:APPVEYOR_PULL_REQUEST_NUMBER.zip" }
- ps: New-Item -Type Directory -Path "$env:APPVEYOR_BUILD_FOLDER\output\"
- ps: rm "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.UI.WindowsForms.Editor\bin\$env:CONFIGURATION\*.pdb"
- ps: Copy-Item -Destination "$env:APPVEYOR_BUILD_FOLDER\output\" -Path "$env:APPVEYOR_BUILD_FOLDER\src\Fahrplanauskunft\Fahrplanauskunft.UI.WindowsForms.Editor\bin\$env:CONFIGURATION\*.*" -Recurse
- ps: New-Item -Type Directory -Path "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\"
- ps: pandoc -s --toc -o "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\BuildProzess.html" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\BuildProzess.md" -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained
- ps: pandoc -s -o "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\BranchingGuide.html" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Projekt\branching_guide.md" -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained
- ps: (Get-Content "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\BranchingGuide.html") -replace 'branching_guide.md', 'BranchingGuide.html' | Set-Content "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\BranchingGuide.html"
- ps: pandoc -s --toc -o "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\DeploymentProzess.html" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\DeploymentProzess.md" -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained
- ps: pandoc -s --toc -o "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Bibliotheken.html" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Architektur\Bibliotheken.md" -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained
- ps: pandoc -s --toc -o "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\FahrplanauskunftSpeicher.html" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Architektur\FahrplanauskunftSpeicher.md" -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained
- ps: >-
$pdflatex = Resolve-Path "C:\Program Files\MiKTeX 2.9\miktex\bin\x64\pdflatex.exe";
& $pdflatex -halt-on-error -output-directory "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Handbuch\" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Handbuch\index.tex";
& $pdflatex -halt-on-error -output-directory "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Handbuch\" "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Handbuch\index.tex";
- ps: Copy-Item -Path "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Handbuch\index.pdf" -Destination "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Handbuch.pdf"
- ps: New-Item -Type Directory -Path "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Objekte\"
- ps: ls "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Objekte\" -Filter *.md | Foreach-Object { pandoc -s --toc -o ("$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Objekte\" + $_.BaseName + ".html") $_.FullName -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained }
- ps: New-Item -Type Directory -Path "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Projekt\"
- ps: New-Item -Type Directory -Path "$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Projekt\ReleaseNotes\"
- ps: ls "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Projekt\ReleaseNotes\*.md" -Exclude releasenotes_template.md | Foreach-Object { pandoc -s --toc -o ("$env:APPVEYOR_BUILD_FOLDER\output\dokumentation\Projekt\ReleaseNotes\" + $_.BaseName + ".html") $_.FullName -c "$env:APPVEYOR_BUILD_FOLDER\Dokumentation\Build\style.css" --self-contained }
- ps: 7z a $env:deploymentfilename "$env:APPVEYOR_BUILD_FOLDER\output\*.*" -r
artifacts:
- path: $(deploymentfilename)
name: fahrplanauskunft
notifications:
- provider: Slack
auth_token:
secure: f2CF/z+WaNuT3IOqnTYhJ0LoGAH4ZNKMvo0tLFJU/iuhwP+61rva1f0urpVtATIcVGztyG2lnBYgYpP/YIrs4/UtgfWildJHI+xmlss7lxs=
channel: builds
# Deploy-Abschnitt
deploy:
# Deploy on FTP-Server
- provider: FTP
protocol: sftp
host:
secure: tp5c67GDLzz96J7IHgjz+O0SXuvihCuXNsOalPgVYJfVXJmRgFLUoqaFOhMv4UHZ
username:
secure: eEnUiKLHsX2sdYjILhZpWw==
password:
secure: ZJXcNUgzLbJCnju6m/s11k+apkDJN2UJkzyMyW7WrEQ=
folder: fahrplanauskunft
artifact: fahrplanauskunft
# GitHub - Releae candidat
- provider: GitHub
draft: false
prerelease: true
description: $($env:CURRENT_RELEASENOTES)
auth_token:
secure: hnDjfSoPrEx64I/3s56hGoVwH/vOuZg/WHW+aKzWtkRCyw8pFrz3NzhAyWR12AEq
tag: $($env:appveyor_build_version)-rc
release: $($env:appveyor_build_version)-rc
artifact: fahrplanauskunft
on:
branch: release/*
# GitHub - Production release
- provider: GitHub
draft: false
prerelease: false
description: $($env:CURRENT_RELEASENOTES)
auth_token:
secure: hnDjfSoPrEx64I/3s56hGoVwH/vOuZg/WHW+aKzWtkRCyw8pFrz3NzhAyWR12AEq
tag: $($env:appveyor_build_version)
release: $($env:appveyor_build_version)
artifact: fahrplanauskunft
on:
branch: master
# BinTray - Production release
- provider: BinTray
username: andrekirst
subject: andrekirst
repo: fahrplanauskunft
api_key:
secure: ITVW09mNALvMUWScQao1Ermu2Ls5ut8Bfc6SROJkoUdEUxErBHpY0pk++4llAWgh
package: fahrplanauskunft
version: $($env:appveyor_build_version)
publish: true
override: true
explode: false
on:
branch: master