2019-09-02 23:03:41 +02:00
|
|
|
# Starter pipeline
|
|
|
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
|
|
|
# Add steps that build, run tests, deploy, and more:
|
|
|
|
# https://aka.ms/yaml
|
|
|
|
|
|
|
|
variables:
|
|
|
|
outputFolder: './_output'
|
|
|
|
artifactsFolder: './_artifacts'
|
|
|
|
testsFolder: './_tests'
|
2019-12-03 02:36:18 +01:00
|
|
|
majorVersion: '3.0.0'
|
2019-09-02 23:03:41 +02:00
|
|
|
minorVersion: $[counter('minorVersion', 2000)]
|
|
|
|
radarrVersion: '$(majorVersion).$(minorVersion)'
|
|
|
|
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
2020-04-28 07:26:05 +02:00
|
|
|
sentryOrg: 'servarr'
|
|
|
|
sentryUrl: 'https://sentry.servarr.com'
|
2020-08-20 03:36:52 +02:00
|
|
|
dotnetVersion: '3.1.401'
|
2020-08-21 04:25:50 +02:00
|
|
|
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- develop
|
2020-09-27 04:03:14 +02:00
|
|
|
- master
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
pr:
|
|
|
|
- develop
|
|
|
|
|
|
|
|
stages:
|
2019-12-24 05:03:04 +01:00
|
|
|
- stage: Setup
|
|
|
|
displayName: Setup
|
|
|
|
jobs:
|
|
|
|
- job:
|
|
|
|
displayName: Build Variables
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-12-24 05:03:04 +01:00
|
|
|
steps:
|
|
|
|
# Set the build name properly. The 'name' property won't recursively expand so hack here:
|
|
|
|
- bash: echo "##vso[build.updatebuildnumber]$RADARRVERSION"
|
|
|
|
displayName: Set Build Name
|
|
|
|
- bash: |
|
2020-01-05 06:41:33 +01:00
|
|
|
if [[ $BUILD_REASON == "PullRequest" ]]; then
|
2020-09-27 04:03:14 +02:00
|
|
|
git diff origin/develop...HEAD --name-only | grep -E "^(src/|azure-pipelines.yml)"
|
2020-01-03 21:34:28 +01:00
|
|
|
echo $? > not_backend_update
|
2020-01-05 06:41:33 +01:00
|
|
|
else
|
|
|
|
echo 0 > not_backend_update
|
|
|
|
fi
|
2020-01-03 21:34:28 +01:00
|
|
|
cat not_backend_update
|
2019-12-24 05:03:04 +01:00
|
|
|
displayName: Check for Backend File Changes
|
2020-01-03 21:34:28 +01:00
|
|
|
- publish: not_backend_update
|
|
|
|
artifact: not_backend_update
|
2019-12-24 05:03:04 +01:00
|
|
|
displayName: Publish update type
|
2019-09-02 23:03:41 +02:00
|
|
|
- stage: Build_Backend
|
|
|
|
displayName: Build Backend
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Setup
|
2019-09-02 23:03:41 +02:00
|
|
|
jobs:
|
|
|
|
- job: Backend
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Linux:
|
|
|
|
osName: 'Linux'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-09-02 23:03:41 +02:00
|
|
|
Mac:
|
|
|
|
osName: 'Mac'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'macos-10.14'
|
2019-09-02 23:03:41 +02:00
|
|
|
Windows:
|
|
|
|
osName: 'Windows'
|
2019-10-14 22:21:00 +02:00
|
|
|
imageName: 'windows-2019'
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
2020-08-21 03:58:38 +02:00
|
|
|
variables:
|
|
|
|
# Disable stylecop here - linting errors get caught by the analyze task
|
|
|
|
EnableAnalyzers: 'false'
|
2019-09-02 23:03:41 +02:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
fetchDepth: 1
|
2019-10-14 22:21:00 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 22:20:59 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: ./build.sh --backend
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Build Radarr Backend
|
2019-10-14 22:20:59 +02:00
|
|
|
- bash: |
|
|
|
|
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
|
|
|
|
find ${OUTPUTFOLDER} -depth -empty -type d -exec rm -r "{}" \;
|
|
|
|
find ${TESTSFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
|
|
|
|
find ${TESTSFOLDER} -depth -empty -type d -exec rm -r "{}" \;
|
|
|
|
displayName: Clean up intermediate output
|
2020-01-19 20:28:04 +01:00
|
|
|
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
|
2019-09-02 23:03:41 +02:00
|
|
|
- publish: $(outputFolder)
|
|
|
|
artifact: '$(osName)Backend'
|
|
|
|
displayName: Publish Backend
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
2019-12-05 22:41:55 +01:00
|
|
|
- publish: '$(testsFolder)/netcoreapp3.1/win-x64/publish'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifact: WindowsCoreTests
|
|
|
|
displayName: Publish Windows Test Package
|
2019-10-14 22:20:59 +02:00
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
|
|
|
- publish: '$(testsFolder)/net462/linux-x64/publish'
|
|
|
|
artifact: LinuxTests
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Publish Linux Mono Test Package
|
2019-10-14 22:20:59 +02:00
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
2019-12-05 22:41:55 +01:00
|
|
|
- publish: '$(testsFolder)/netcoreapp3.1/linux-x64/publish'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifact: LinuxCoreTests
|
|
|
|
displayName: Publish Linux Test Package
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
2020-07-26 22:52:27 +02:00
|
|
|
- publish: '$(testsFolder)/netcoreapp3.1/linux-musl-x64/publish'
|
|
|
|
artifact: LinuxMuslCoreTests
|
|
|
|
displayName: Publish Linux Musl Test Package
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
2019-12-05 22:41:55 +01:00
|
|
|
- publish: '$(testsFolder)/netcoreapp3.1/osx-x64/publish'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifact: MacCoreTests
|
|
|
|
displayName: Publish MacOS Test Package
|
2019-09-02 23:03:41 +02:00
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
|
|
|
|
|
|
|
- stage: Build_Frontend
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Frontend
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Setup
|
2019-09-02 23:03:41 +02:00
|
|
|
jobs:
|
2019-10-14 22:21:00 +02:00
|
|
|
- job: Build
|
2019-09-02 23:03:41 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Linux:
|
|
|
|
osName: 'Linux'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-09-02 23:03:41 +02:00
|
|
|
Mac:
|
|
|
|
osName: 'Mac'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'macos-10.14'
|
2019-09-02 23:03:41 +02:00
|
|
|
Windows:
|
|
|
|
osName: 'Windows'
|
2019-10-14 22:21:00 +02:00
|
|
|
imageName: 'windows-2019'
|
2019-09-02 23:03:41 +02:00
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: Set Node.js version
|
|
|
|
inputs:
|
|
|
|
versionSpec: '10.x'
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
fetchDepth: 1
|
2020-08-21 04:25:50 +02:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(osName)" | yarn.lock'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(osName)"
|
|
|
|
yarn
|
|
|
|
path: $(yarnCacheFolder)
|
|
|
|
displayName: Cache Yarn packages
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: ./build.sh --frontend
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Build Radarr Frontend
|
|
|
|
env:
|
|
|
|
FORCE_COLOR: 0
|
2020-08-21 04:25:50 +02:00
|
|
|
YARN_CACHE_FOLDER: $(yarnCacheFolder)
|
2019-09-02 23:03:41 +02:00
|
|
|
- publish: $(outputFolder)
|
|
|
|
artifact: '$(osName)Frontend'
|
|
|
|
displayName: Publish Frontend
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- stage: Installer
|
2019-09-02 23:03:41 +02:00
|
|
|
dependsOn:
|
|
|
|
- Build_Backend
|
|
|
|
- Build_Frontend
|
|
|
|
jobs:
|
|
|
|
- job: Windows_Installer
|
|
|
|
displayName: Create Installer
|
|
|
|
pool:
|
2019-10-14 22:21:00 +02:00
|
|
|
vmImage: 'windows-2019'
|
2019-09-02 23:03:41 +02:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: WindowsBackend
|
|
|
|
targetPath: _output
|
|
|
|
displayName: Fetch Backend
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: WindowsFrontend
|
|
|
|
targetPath: _output
|
|
|
|
displayName: Fetch Frontend
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: ./build.sh --packages
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Create Packages
|
|
|
|
- bash: |
|
2019-12-05 22:41:55 +01:00
|
|
|
setup/inno/ISCC.exe setup/radarr.iss //DFramework=netcoreapp3.1
|
|
|
|
cp setup/output/Radarr.*windows.netcoreapp3.1.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-core-x64-installer.exe
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Create .NET Core Windows installer
|
2019-09-02 23:03:41 +02:00
|
|
|
- publish: $(Build.ArtifactStagingDirectory)
|
|
|
|
artifact: 'WindowsInstaller'
|
|
|
|
displayName: Publish Installer
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
- stage: Packages
|
|
|
|
dependsOn:
|
|
|
|
- Build_Backend
|
|
|
|
- Build_Frontend
|
|
|
|
jobs:
|
2019-09-02 23:03:41 +02:00
|
|
|
- job: Other_Packages
|
|
|
|
displayName: Create Standard Packages
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-09-02 23:03:41 +02:00
|
|
|
steps:
|
|
|
|
- checkout: self
|
|
|
|
fetchDepth: 1
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: WindowsBackend
|
|
|
|
targetPath: _output
|
|
|
|
displayName: Fetch Backend
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: WindowsFrontend
|
|
|
|
targetPath: _output
|
|
|
|
displayName: Fetch Frontend
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: ./build.sh --packages
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Create Packages
|
|
|
|
- bash: |
|
2019-10-14 22:21:00 +02:00
|
|
|
find . -name "Radarr" -exec chmod a+x {} \;
|
|
|
|
find . -name "Radarr.Update" -exec chmod a+x {} \;
|
|
|
|
displayName: Set executable bits
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: ArchiveFiles@2
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Create Windows Core zip
|
2019-09-02 23:03:41 +02:00
|
|
|
inputs:
|
2019-10-14 23:42:30 +02:00
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows-core-x64.zip'
|
2019-09-02 23:03:41 +02:00
|
|
|
archiveType: 'zip'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/windows/netcoreapp3.1
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: ArchiveFiles@2
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Create MacOS Core app
|
2019-09-02 23:03:41 +02:00
|
|
|
inputs:
|
2019-10-14 23:42:30 +02:00
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app-core-x64.zip'
|
2019-09-02 23:03:41 +02:00
|
|
|
archiveType: 'zip'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/macos-app/netcoreapp3.1
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: ArchiveFiles@2
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Create MacOS Core tar
|
2019-09-02 23:03:41 +02:00
|
|
|
inputs:
|
2019-10-14 23:42:30 +02:00
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-core-x64.tar.gz'
|
2019-09-02 23:03:41 +02:00
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/macos/netcoreapp3.1
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: ArchiveFiles@2
|
2019-10-14 23:42:30 +02:00
|
|
|
displayName: Create Linux Mono tar
|
2019-09-02 23:03:41 +02:00
|
|
|
inputs:
|
2019-10-14 22:21:00 +02:00
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux.tar.gz'
|
2019-09-02 23:03:41 +02:00
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
2019-10-14 22:21:00 +02:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-x64/net462
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Create Linux Core tar
|
|
|
|
inputs:
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-x64.tar.gz'
|
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-x64/netcoreapp3.1
|
2020-07-26 22:52:27 +02:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Create Linux Musl Core tar
|
|
|
|
inputs:
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-x64.tar.gz'
|
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-musl-x64/netcoreapp3.1
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Create ARM32 Linux Core tar
|
|
|
|
inputs:
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm.tar.gz'
|
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-arm/netcoreapp3.1
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Create ARM64 Linux Core tar
|
|
|
|
inputs:
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-core-arm64.tar.gz'
|
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
2019-12-05 22:41:55 +01:00
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-arm64/netcoreapp3.1
|
2020-07-26 22:52:27 +02:00
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: Create ARM64 Linux Musl Core tar
|
|
|
|
inputs:
|
|
|
|
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux-musl-core-arm64.tar.gz'
|
|
|
|
archiveType: 'tar'
|
|
|
|
tarCompression: 'gz'
|
|
|
|
includeRootFolder: false
|
|
|
|
rootFolderOrFile: $(artifactsFolder)/linux-musl-arm64/netcoreapp3.1
|
2019-09-02 23:03:41 +02:00
|
|
|
- publish: $(Build.ArtifactStagingDirectory)
|
|
|
|
artifact: 'Packages'
|
|
|
|
displayName: Publish Packages
|
|
|
|
- bash: |
|
|
|
|
echo "Uploading source maps to sentry"
|
|
|
|
curl -sL https://sentry.io/get-cli/ | bash
|
|
|
|
RELEASENAME="${RADARRVERSION}-${BUILD_SOURCEBRANCHNAME}"
|
2020-04-28 08:13:49 +02:00
|
|
|
sentry-cli releases new --finalize -p radarr -p radarr-ui -p radarr-update "${RELEASENAME}"
|
|
|
|
sentry-cli releases -p radarr-ui files "${RELEASENAME}" upload-sourcemaps _output/UI/ --rewrite
|
2019-09-02 23:03:41 +02:00
|
|
|
sentry-cli releases set-commits --auto "${RELEASENAME}"
|
2020-09-27 04:03:14 +02:00
|
|
|
if [[ ${BUILD_SOURCEBRANCH} == "refs/heads/develop" ]]; then
|
|
|
|
sentry-cli releases deploys "${RELEASENAME}" new -e nightly
|
|
|
|
else
|
|
|
|
sentry-cli releases deploys "${RELEASENAME}" new -e production
|
|
|
|
fi
|
2020-04-22 20:18:38 +02:00
|
|
|
if [ $? -gt 0 ]; then
|
2020-04-22 20:02:16 +02:00
|
|
|
echo "##vso[task.logissue type=warning]Error uploading source maps."
|
|
|
|
fi
|
|
|
|
exit 0
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Publish Sentry Source Maps
|
2020-09-27 04:03:14 +02:00
|
|
|
condition: |
|
|
|
|
or
|
|
|
|
(
|
|
|
|
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop')),
|
|
|
|
and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
|
|
)
|
2019-09-02 23:03:41 +02:00
|
|
|
env:
|
2020-04-28 07:26:05 +02:00
|
|
|
SENTRY_AUTH_TOKEN: $(sentryAuthTokenServarr)
|
2019-09-02 23:03:41 +02:00
|
|
|
SENTRY_ORG: $(sentryOrg)
|
2020-04-28 07:26:05 +02:00
|
|
|
SENTRY_URL: $(sentryUrl)
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
- stage: Unit_Test
|
|
|
|
displayName: Unit Tests
|
|
|
|
dependsOn: Build_Backend
|
2019-12-24 05:03:04 +01:00
|
|
|
|
2019-09-02 23:03:41 +02:00
|
|
|
jobs:
|
2019-12-24 05:03:04 +01:00
|
|
|
- job: Prepare
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-12-24 05:03:04 +01:00
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2020-01-03 21:34:28 +01:00
|
|
|
artifactName: 'not_backend_update'
|
2019-12-24 05:03:04 +01:00
|
|
|
targetPath: '.'
|
2020-01-03 21:34:28 +01:00
|
|
|
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
|
2019-12-24 05:03:04 +01:00
|
|
|
name: setVar
|
|
|
|
|
2019-09-02 23:03:41 +02:00
|
|
|
- job: Unit
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Unit Native
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Prepare
|
2020-01-03 21:34:28 +01:00
|
|
|
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
2019-12-24 05:03:04 +01:00
|
|
|
|
2019-09-02 23:03:41 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-10-14 23:42:30 +02:00
|
|
|
MacCore:
|
2019-09-02 23:03:41 +02:00
|
|
|
osName: 'Mac'
|
2019-10-14 23:42:30 +02:00
|
|
|
testName: 'MacCore'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'macos-10.14'
|
2019-10-14 23:42:30 +02:00
|
|
|
WindowsCore:
|
2019-09-02 23:03:41 +02:00
|
|
|
osName: 'Windows'
|
2019-10-14 23:42:30 +02:00
|
|
|
testName: 'WindowsCore'
|
2019-10-14 22:21:00 +02:00
|
|
|
imageName: 'windows-2019'
|
2019-10-14 23:42:30 +02:00
|
|
|
LinuxCore:
|
|
|
|
osName: 'Linux'
|
|
|
|
testName: 'LinuxCore'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.linux-core-x64.tar.gz'
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: none
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 23:42:30 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Test Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifactName: '$(testName)Tests'
|
2019-09-02 23:03:41 +02:00
|
|
|
targetPath: $(testsFolder)
|
2019-09-03 04:22:25 +02:00
|
|
|
- bash: |
|
2020-01-22 22:47:33 +01:00
|
|
|
wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-11_all.deb
|
|
|
|
sudo dpkg -i repo-mediaarea_1.0-11_all.deb
|
2019-09-03 04:22:25 +02:00
|
|
|
sudo apt-get update
|
2020-01-22 22:47:33 +01:00
|
|
|
sudo apt-get install -y --allow-unauthenticated libmediainfo-dev libmediainfo0v5 mediainfo
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Install mediainfo
|
2019-09-03 04:22:25 +02:00
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
2019-09-02 23:03:41 +02:00
|
|
|
- powershell: Set-Service SCardSvr -StartupType Manual
|
|
|
|
displayName: Enable Windows Test Service
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: |
|
2020-01-24 23:13:10 +01:00
|
|
|
SYMLINK=6_6_0
|
2019-10-14 22:21:00 +02:00
|
|
|
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
|
|
|
|
echo "##vso[task.setvariable variable=MONOPREFIX;]$MONOPREFIX"
|
|
|
|
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
|
|
|
|
displayName: Set Mono Version
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
|
2019-10-14 22:20:59 +02:00
|
|
|
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
|
|
|
|
displayName: Make Test Dummy Executable
|
2020-01-19 20:28:04 +01:00
|
|
|
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
|
2020-02-25 23:17:55 +01:00
|
|
|
- bash: |
|
|
|
|
chmod a+x ${TESTSFOLDER}/test.sh
|
|
|
|
${TESTSFOLDER}/test.sh ${OSNAME} Unit Test
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Run Tests
|
|
|
|
env:
|
|
|
|
TEST_DIR: $(Build.SourcesDirectory)/_tests
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'NUnit'
|
|
|
|
testResultsFiles: '**/TestResult.xml'
|
2019-10-14 23:42:30 +02:00
|
|
|
testRunTitle: '$(testName) Unit Tests'
|
2019-10-14 22:21:00 +02:00
|
|
|
failTaskOnFailedTests: true
|
|
|
|
|
|
|
|
- job: Unit_Docker
|
|
|
|
displayName: Unit Docker
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Prepare
|
2020-01-03 21:34:28 +01:00
|
|
|
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
2019-10-14 22:21:00 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
mono520:
|
|
|
|
testName: 'Mono 5.20'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-03-07 04:25:49 +01:00
|
|
|
containerImage: servarr/testimages:mono-5.20
|
2020-01-20 23:00:25 +01:00
|
|
|
mono610:
|
|
|
|
testName: 'Mono 6.10'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-03-07 04:25:49 +01:00
|
|
|
containerImage: servarr/testimages:mono-6.10
|
2020-07-21 22:00:30 +02:00
|
|
|
mono612:
|
|
|
|
testName: 'Mono 6.12'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-07-21 22:00:30 +02:00
|
|
|
containerImage: servarr/testimages:mono-6.12
|
2020-07-26 22:52:27 +02:00
|
|
|
alpine:
|
|
|
|
testName: 'Musl Net Core'
|
|
|
|
artifactName: LinuxMuslCoreTests
|
|
|
|
containerImage: servarr/testimages:alpine
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
container: $[ variables['containerImage'] ]
|
2019-09-02 23:03:41 +02:00
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
timeoutInMinutes: 10
|
|
|
|
|
|
|
|
steps:
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 23:42:30 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-10-14 22:21:00 +02:00
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Test Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: $(artifactName)
|
2019-10-14 22:21:00 +02:00
|
|
|
targetPath: $(testsFolder)
|
2020-07-26 22:52:27 +02:00
|
|
|
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
|
|
|
|
displayName: Make Test Dummy Executable
|
|
|
|
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
|
2020-02-25 23:17:55 +01:00
|
|
|
- bash: |
|
|
|
|
chmod a+x ${TESTSFOLDER}/test.sh
|
2020-07-26 22:52:27 +02:00
|
|
|
ls -lR ${TESTSFOLDER}
|
2020-02-25 23:17:55 +01:00
|
|
|
${TESTSFOLDER}/test.sh Linux Unit Test
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Run Tests
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'NUnit'
|
|
|
|
testResultsFiles: '**/TestResult.xml'
|
|
|
|
testRunTitle: '$(testName) Unit Tests'
|
|
|
|
failTaskOnFailedTests: true
|
|
|
|
|
|
|
|
- stage: Integration
|
|
|
|
displayName: Integration
|
|
|
|
dependsOn: Packages
|
2019-12-24 05:03:04 +01:00
|
|
|
|
2019-09-02 23:03:41 +02:00
|
|
|
jobs:
|
2019-12-24 05:03:04 +01:00
|
|
|
- job: Prepare
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-12-24 05:03:04 +01:00
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2020-01-03 21:34:28 +01:00
|
|
|
artifactName: 'not_backend_update'
|
2019-12-24 05:03:04 +01:00
|
|
|
targetPath: '.'
|
2020-01-03 21:34:28 +01:00
|
|
|
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
|
2019-12-24 05:03:04 +01:00
|
|
|
name: setVar
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- job: Integration_Native
|
|
|
|
displayName: Integration Native
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Prepare
|
2020-01-03 21:34:28 +01:00
|
|
|
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
2019-09-02 23:03:41 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2019-10-14 23:42:30 +02:00
|
|
|
MacCore:
|
2019-09-02 23:03:41 +02:00
|
|
|
osName: 'Mac'
|
2019-10-14 23:42:30 +02:00
|
|
|
testName: 'MacCore'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'macos-10.14'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.osx-core-x64.tar.gz'
|
|
|
|
WindowsCore:
|
2019-09-02 23:03:41 +02:00
|
|
|
osName: 'Windows'
|
2019-10-14 23:42:30 +02:00
|
|
|
testName: 'WindowsCore'
|
2019-10-14 22:21:00 +02:00
|
|
|
imageName: 'windows-2019'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.windows-core-x64.zip'
|
|
|
|
LinuxCore:
|
|
|
|
osName: 'Linux'
|
|
|
|
testName: 'LinuxCore'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.linux-core-x64.tar.gz'
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- bash: |
|
2020-01-24 23:13:10 +01:00
|
|
|
SYMLINK=6_6_0
|
2019-09-02 23:03:41 +02:00
|
|
|
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
|
2019-10-14 22:21:00 +02:00
|
|
|
echo "##vso[task.setvariable variable=MONOPREFIX;]$MONOPREFIX"
|
2019-09-02 23:03:41 +02:00
|
|
|
echo "##vso[task.setvariable variable=PKG_CONFIG_PATH;]$MONOPREFIX/lib/pkgconfig:$MONOPREFIX/share/pkgconfig:$PKG_CONFIG_PATH"
|
|
|
|
echo "##vso[task.setvariable variable=PATH;]$MONOPREFIX/bin:$PATH"
|
|
|
|
displayName: Set Mono Version
|
|
|
|
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 23:42:30 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-09-02 23:03:41 +02:00
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Test Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifactName: '$(testName)Tests'
|
2019-09-02 23:03:41 +02:00
|
|
|
targetPath: $(testsFolder)
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Build Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: Packages
|
|
|
|
itemPattern: '**/$(pattern)'
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
- task: ExtractFiles@1
|
|
|
|
inputs:
|
|
|
|
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
|
|
|
|
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
|
|
|
displayName: Extract Package
|
|
|
|
- bash: |
|
|
|
|
mkdir -p ./bin/
|
|
|
|
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
|
|
|
|
displayName: Move Package Contents
|
2020-02-25 23:17:55 +01:00
|
|
|
- bash: |
|
|
|
|
chmod a+x ${TESTSFOLDER}/test.sh
|
|
|
|
${TESTSFOLDER}/test.sh ${OSNAME} Integration Test
|
2019-09-02 23:03:41 +02:00
|
|
|
displayName: Run Integration Tests
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'NUnit'
|
|
|
|
testResultsFiles: '**/TestResult.xml'
|
2019-10-14 23:42:30 +02:00
|
|
|
testRunTitle: '$(testName) Integration Tests'
|
2019-09-02 23:03:41 +02:00
|
|
|
failTaskOnFailedTests: true
|
|
|
|
displayName: Publish Test Results
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- job: Integration_Docker
|
|
|
|
displayName: Integration Docker
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Prepare
|
2020-01-03 21:34:28 +01:00
|
|
|
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
2019-10-14 22:21:00 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
mono520:
|
|
|
|
testName: 'Mono 5.20'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-03-07 04:25:49 +01:00
|
|
|
containerImage: servarr/testimages:mono-5.20
|
2020-07-26 22:52:27 +02:00
|
|
|
pattern: 'Radarr.**.linux.tar.gz'
|
2020-01-20 23:00:25 +01:00
|
|
|
mono610:
|
|
|
|
testName: 'Mono 6.10'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-03-07 04:25:49 +01:00
|
|
|
containerImage: servarr/testimages:mono-6.10
|
2020-07-26 22:52:27 +02:00
|
|
|
pattern: 'Radarr.**.linux.tar.gz'
|
2020-07-21 22:00:30 +02:00
|
|
|
mono612:
|
|
|
|
testName: 'Mono 6.12'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: LinuxTests
|
2020-07-21 22:00:30 +02:00
|
|
|
containerImage: servarr/testimages:mono-6.12
|
2020-07-26 22:52:27 +02:00
|
|
|
pattern: 'Radarr.**.linux.tar.gz'
|
|
|
|
alpine:
|
|
|
|
testName: 'Musl Net Core'
|
2020-08-17 23:18:47 +02:00
|
|
|
artifactName: LinuxMuslCoreTests
|
2020-07-26 22:52:27 +02:00
|
|
|
containerImage: servarr/testimages:alpine
|
|
|
|
pattern: 'Radarr.**.linux-musl-core-x64.tar.gz'
|
2019-10-14 22:21:00 +02:00
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
container: $[ variables['containerImage'] ]
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
timeoutInMinutes: 15
|
2019-10-14 22:21:00 +02:00
|
|
|
|
|
|
|
steps:
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 23:42:30 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-10-14 22:21:00 +02:00
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Test Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2020-07-26 22:52:27 +02:00
|
|
|
artifactName: $(artifactName)
|
2019-10-14 22:21:00 +02:00
|
|
|
targetPath: $(testsFolder)
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Build Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: Packages
|
|
|
|
itemPattern: '**/$(pattern)'
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
- task: ExtractFiles@1
|
|
|
|
inputs:
|
|
|
|
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
|
|
|
|
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
|
|
|
displayName: Extract Package
|
|
|
|
- bash: |
|
|
|
|
mkdir -p ./bin/
|
|
|
|
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
|
|
|
|
displayName: Move Package Contents
|
2020-02-25 23:17:55 +01:00
|
|
|
- bash: |
|
|
|
|
chmod a+x ${TESTSFOLDER}/test.sh
|
|
|
|
${TESTSFOLDER}/test.sh Linux Integration Test
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Run Integration Tests
|
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'NUnit'
|
|
|
|
testResultsFiles: '**/TestResult.xml'
|
|
|
|
testRunTitle: '$(testName) Integration Tests'
|
|
|
|
failTaskOnFailedTests: true
|
|
|
|
displayName: Publish Test Results
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- stage: Automation
|
|
|
|
displayName: Automation
|
|
|
|
dependsOn: Packages
|
|
|
|
|
|
|
|
jobs:
|
2019-09-02 23:03:41 +02:00
|
|
|
- job: Automation
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Linux:
|
|
|
|
osName: 'Linux'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.linux-core-x64.tar.gz'
|
2019-09-02 23:03:41 +02:00
|
|
|
failBuild: true
|
|
|
|
Mac:
|
|
|
|
osName: 'Mac'
|
2020-08-18 05:33:22 +02:00
|
|
|
imageName: 'macos-10.14'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.osx-core-x64.tar.gz'
|
2020-08-18 05:33:22 +02:00
|
|
|
failBuild: true
|
2019-09-02 23:03:41 +02:00
|
|
|
Windows:
|
|
|
|
osName: 'Windows'
|
2019-10-14 22:21:00 +02:00
|
|
|
imageName: 'windows-2019'
|
2019-10-14 23:42:30 +02:00
|
|
|
pattern: 'Radarr.**.windows-core-x64.zip'
|
2020-08-18 05:33:22 +02:00
|
|
|
failBuild: true
|
2019-09-02 23:03:41 +02:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
|
|
|
|
|
|
|
steps:
|
2019-10-14 23:42:30 +02:00
|
|
|
- task: UseDotNet@2
|
2019-12-05 22:41:55 +01:00
|
|
|
displayName: 'Install .net core'
|
2019-10-14 23:42:30 +02:00
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
2019-09-02 23:03:41 +02:00
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Test Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2019-10-14 23:42:30 +02:00
|
|
|
artifactName: '$(osName)CoreTests'
|
2019-09-02 23:03:41 +02:00
|
|
|
targetPath: $(testsFolder)
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
displayName: Download Build Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: Packages
|
|
|
|
itemPattern: '**/$(pattern)'
|
|
|
|
targetPath: $(Build.ArtifactStagingDirectory)
|
|
|
|
- task: ExtractFiles@1
|
|
|
|
inputs:
|
|
|
|
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/$(pattern)'
|
|
|
|
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
|
|
|
displayName: Extract Package
|
|
|
|
- bash: |
|
|
|
|
mkdir -p ./bin/
|
|
|
|
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
|
|
|
|
displayName: Move Package Contents
|
2020-02-25 23:17:55 +01:00
|
|
|
- bash: |
|
|
|
|
chmod a+x ${TESTSFOLDER}/test.sh
|
|
|
|
${TESTSFOLDER}/test.sh ${OSNAME} Automation Test
|
2020-08-17 22:11:02 +02:00
|
|
|
displayName: Run Automation Tests
|
2020-10-08 06:07:52 +02:00
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: 'Copy Screenshot to: $(Build.ArtifactStagingDirectory)'
|
|
|
|
inputs:
|
|
|
|
SourceFolder: '$(Build.SourcesDirectory)'
|
|
|
|
Contents: |
|
|
|
|
**/*_test_screenshot.png
|
|
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)/screenshots'
|
|
|
|
- publish: $(Build.ArtifactStagingDirectory)/screenshots
|
|
|
|
artifact: '$(osName)AutomationScreenshots'
|
|
|
|
displayName: Publish Screenshot Bundle
|
2020-10-16 03:14:27 +02:00
|
|
|
condition: and(succeeded(), eq(variables['System.JobAttempt'], '1'))
|
2019-09-02 23:03:41 +02:00
|
|
|
- task: PublishTestResults@2
|
|
|
|
inputs:
|
|
|
|
testResultsFormat: 'NUnit'
|
|
|
|
testResultsFiles: '**/TestResult.xml'
|
|
|
|
testRunTitle: '$(osName) Automation Tests'
|
|
|
|
failTaskOnFailedTests: $(failBuild)
|
|
|
|
displayName: Publish Test Results
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- stage: Analyze
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn:
|
|
|
|
- Setup
|
2019-10-14 22:21:00 +02:00
|
|
|
displayName: Analyze
|
|
|
|
|
|
|
|
jobs:
|
2019-12-24 05:03:04 +01:00
|
|
|
- job: Prepare
|
|
|
|
pool:
|
2020-01-24 23:13:10 +01:00
|
|
|
vmImage: 'ubuntu-18.04'
|
2019-12-24 05:03:04 +01:00
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
- task: DownloadPipelineArtifact@2
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
2020-01-03 21:34:28 +01:00
|
|
|
artifactName: 'not_backend_update'
|
2019-12-24 05:03:04 +01:00
|
|
|
targetPath: '.'
|
2020-01-03 21:34:28 +01:00
|
|
|
- bash: echo "##vso[task.setvariable variable=backendNotUpdated;isOutput=true]$(cat not_backend_update)"
|
2019-12-24 05:03:04 +01:00
|
|
|
name: setVar
|
|
|
|
|
2019-10-14 22:21:00 +02:00
|
|
|
- job: Lint_Frontend
|
|
|
|
displayName: Lint Frontend
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Linux:
|
|
|
|
osName: 'Linux'
|
2020-01-24 23:13:10 +01:00
|
|
|
imageName: 'ubuntu-18.04'
|
2019-10-14 22:21:00 +02:00
|
|
|
Windows:
|
|
|
|
osName: 'Windows'
|
|
|
|
imageName: 'windows-2019'
|
|
|
|
pool:
|
|
|
|
vmImage: $(imageName)
|
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: Set Node.js version
|
|
|
|
inputs:
|
|
|
|
versionSpec: '10.x'
|
|
|
|
- checkout: self
|
|
|
|
submodules: true
|
|
|
|
fetchDepth: 1
|
2020-08-21 04:25:50 +02:00
|
|
|
- task: Cache@2
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | "$(osName)" | yarn.lock'
|
|
|
|
restoreKeys: |
|
|
|
|
yarn | "$(osName)"
|
|
|
|
yarn
|
|
|
|
path: $(yarnCacheFolder)
|
|
|
|
displayName: Cache Yarn packages
|
2019-10-14 22:21:00 +02:00
|
|
|
- bash: ./build.sh --lint
|
|
|
|
displayName: Lint Radarr Frontend
|
|
|
|
env:
|
|
|
|
FORCE_COLOR: 0
|
2020-08-21 04:25:50 +02:00
|
|
|
YARN_CACHE_FOLDER: $(yarnCacheFolder)
|
2019-10-14 22:21:00 +02:00
|
|
|
|
2019-12-07 08:37:11 +01:00
|
|
|
- job: Analyze_Frontend
|
|
|
|
displayName: Frontend
|
2019-12-10 03:48:14 +01:00
|
|
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
2019-12-07 08:37:11 +01:00
|
|
|
pool:
|
|
|
|
vmImage: windows-2019
|
|
|
|
steps:
|
|
|
|
- checkout: self # Need history for Sonar analysis
|
|
|
|
- task: SonarCloudPrepare@1
|
|
|
|
env:
|
|
|
|
SONAR_SCANNER_OPTS: ''
|
|
|
|
inputs:
|
|
|
|
SonarCloud: 'SonarCloud'
|
|
|
|
organization: 'radarr'
|
|
|
|
scannerMode: 'CLI'
|
|
|
|
configMode: 'manual'
|
|
|
|
cliProjectKey: 'Radarr_Radarr.UI'
|
2019-12-10 03:48:14 +01:00
|
|
|
cliProjectName: 'RadarrUI'
|
2019-12-07 08:37:11 +01:00
|
|
|
cliProjectVersion: '$(radarrVersion)'
|
|
|
|
cliSources: './frontend'
|
|
|
|
- task: SonarCloudAnalyze@1
|
2019-09-02 23:03:41 +02:00
|
|
|
|
2019-12-07 08:37:11 +01:00
|
|
|
- job: Analyze_Backend
|
|
|
|
displayName: Backend
|
2019-12-24 05:03:04 +01:00
|
|
|
dependsOn: Prepare
|
2020-01-03 21:34:28 +01:00
|
|
|
condition: and(succeeded(), eq(dependencies.Prepare.outputs['setVar.backendNotUpdated'], '0'))
|
2019-12-24 05:03:04 +01:00
|
|
|
|
2019-12-07 08:37:11 +01:00
|
|
|
variables:
|
|
|
|
disable.coverage.autogenerate: 'true'
|
2019-12-24 05:03:04 +01:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: windows-2019
|
|
|
|
|
2019-12-07 08:37:11 +01:00
|
|
|
steps:
|
|
|
|
- task: UseDotNet@2
|
|
|
|
displayName: 'Install .net core'
|
|
|
|
inputs:
|
|
|
|
version: $(dotnetVersion)
|
|
|
|
- checkout: self # Need history for Sonar analysis
|
|
|
|
submodules: true
|
|
|
|
- powershell: Set-Service SCardSvr -StartupType Manual
|
|
|
|
displayName: Enable Windows Test Service
|
|
|
|
- task: SonarCloudPrepare@1
|
2019-12-10 03:48:14 +01:00
|
|
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
2019-12-07 08:37:11 +01:00
|
|
|
inputs:
|
|
|
|
SonarCloud: 'SonarCloud'
|
|
|
|
organization: 'radarr'
|
|
|
|
scannerMode: 'MSBuild'
|
|
|
|
projectKey: 'Radarr_Radarr'
|
|
|
|
projectName: 'Radarr'
|
|
|
|
projectVersion: '$(radarrVersion)'
|
|
|
|
extraProperties: |
|
|
|
|
sonar.exclusions=**/obj/**,**/*.dll,**/NzbDrone.Core.Test/Files/**/*,./frontend/**,**/ExternalModules/**,./src/Libraries/**
|
2019-12-24 22:43:47 +01:00
|
|
|
sonar.coverage.exclusions=**/Radarr.Api.V3/**/*,**/NzbDrone.Api/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
2019-12-07 08:37:11 +01:00
|
|
|
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml
|
|
|
|
sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
|
|
|
- bash: |
|
|
|
|
./build.sh --backend -f netcoreapp3.1 -r win-x64
|
|
|
|
TEST_DIR=_tests/netcoreapp3.1/win-x64/publish/ ./test.sh Windows Unit Coverage
|
|
|
|
displayName: Coverage Unit Tests
|
|
|
|
- task: SonarCloudAnalyze@1
|
2019-12-10 03:48:14 +01:00
|
|
|
condition: eq(variables['System.PullRequest.IsFork'], 'False')
|
2019-12-07 08:37:11 +01:00
|
|
|
displayName: Publish SonarCloud Results
|
|
|
|
- task: reportgenerator@4
|
|
|
|
displayName: Generate Coverage Report
|
|
|
|
inputs:
|
|
|
|
reports: '$(Build.SourcesDirectory)/CoverageResults/**/coverage.opencover.xml'
|
|
|
|
targetdir: '$(Build.SourcesDirectory)/CoverageResults/combined'
|
|
|
|
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
|
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
displayName: Publish Coverage Report
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: 'cobertura'
|
|
|
|
summaryFileLocation: './CoverageResults/combined/Cobertura.xml'
|
2019-12-22 22:42:56 +01:00
|
|
|
reportDirectory: './CoverageResults/combined/'
|
2020-04-22 23:04:43 +02:00
|
|
|
|
|
|
|
- stage: Report_Out
|
|
|
|
dependsOn:
|
|
|
|
- Analyze
|
|
|
|
- Unit_Test
|
|
|
|
- Integration
|
|
|
|
- Automation
|
2020-05-14 08:17:11 +02:00
|
|
|
condition: eq(variables['system.pullrequest.isfork'], false)
|
2020-04-22 23:04:43 +02:00
|
|
|
displayName: Build Status Report
|
|
|
|
jobs:
|
|
|
|
- job:
|
|
|
|
displayName: Discord Notification
|
|
|
|
pool:
|
2020-10-08 06:07:52 +02:00
|
|
|
vmImage: 'windows-2019'
|
2020-04-22 23:04:43 +02:00
|
|
|
steps:
|
2020-10-08 06:07:52 +02:00
|
|
|
- task: DownloadPipelineArtifact@2
|
2020-10-14 03:53:17 +02:00
|
|
|
continueOnError: true
|
2020-10-08 06:07:52 +02:00
|
|
|
displayName: Download Screenshot Artifact
|
|
|
|
inputs:
|
|
|
|
buildType: 'current'
|
|
|
|
artifactName: 'WindowsAutomationScreenshots'
|
|
|
|
targetPath: $(Build.SourcesDirectory)
|
2020-04-22 23:04:43 +02:00
|
|
|
- checkout: none
|
|
|
|
- powershell: |
|
2020-04-24 22:04:28 +02:00
|
|
|
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Servarr/AzureDiscordNotify/master/DiscordNotify.ps1'))
|
2020-04-22 23:04:43 +02:00
|
|
|
env:
|
2020-04-24 22:04:28 +02:00
|
|
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
|
|
|
DISCORDCHANNELID: $(discordChannelId)
|
|
|
|
DISCORDWEBHOOKKEY: $(discordWebhookKey)
|
|
|
|
|