You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
432 lines
14 KiB
432 lines
14 KiB
4 years ago
|
# 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'
|
||
|
majorVersion: '0.2.0'
|
||
|
minorVersion: $[counter('minorVersionOld', 1510)]
|
||
|
radarrVersion: '$(majorVersion).$(minorVersion)'
|
||
|
buildName: '$(Build.SourceBranchName).$(radarrVersion)'
|
||
|
windowsInstaller: 'Radarr.$(buildName).windows-installer.exe'
|
||
|
windowsZip: 'Radarr.$(buildName).windows.zip'
|
||
|
macOsApp: 'Radarr.$(buildName).osx-app.zip'
|
||
|
macOsTar: 'Radarr.$(buildName).osx.tar.gz'
|
||
|
linuxTar: 'Radarr.$(buildName).linux.tar.gz'
|
||
|
|
||
|
trigger:
|
||
|
branches:
|
||
|
include:
|
||
|
- develop
|
||
|
- aphrodite
|
||
|
|
||
|
pr:
|
||
|
- develop
|
||
|
- aphrodite
|
||
|
|
||
|
stages:
|
||
|
- stage: Build_Backend
|
||
|
displayName: Build Backend
|
||
|
|
||
|
jobs:
|
||
|
- job: Backend
|
||
|
strategy:
|
||
|
matrix:
|
||
|
Linux:
|
||
|
osName: 'Linux'
|
||
|
imageName: 'ubuntu-18.04'
|
||
|
Mac:
|
||
|
osName: 'Mac'
|
||
|
imageName: 'macos-10.14'
|
||
|
Windows:
|
||
|
osName: 'Windows'
|
||
|
imageName: 'windows-2019'
|
||
|
|
||
|
pool:
|
||
|
vmImage: $(imageName)
|
||
|
steps:
|
||
|
# Set the build name properly. The 'name' property won't recursively expand so hack here:
|
||
|
- powershell: Write-Host "##vso[build.updatebuildnumber]$($env:RADARRVERSION)"
|
||
|
displayName: Set Build Name
|
||
|
- checkout: self
|
||
|
submodules: true
|
||
|
fetchDepth: 1
|
||
|
- task: Assembly-Info-NetFramework@2
|
||
|
displayName: Patch AssemblyInfo
|
||
|
inputs:
|
||
|
Path: '$(Build.SourcesDirectory)'
|
||
|
FileNames: 'src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs'
|
||
|
InsertAttributes: false
|
||
|
FileEncoding: 'auto'
|
||
|
WriteBOM: false
|
||
|
Configuration: 'debug'
|
||
|
VersionNumber: '$(radarrVersion)'
|
||
|
FileVersionNumber: '$(radarrVersion)'
|
||
|
InformationalVersion: '$(radarrVersion)-rc1'
|
||
|
- bash: ./build.sh --only-backend
|
||
|
displayName: Build Radarr Backend
|
||
|
- publish: $(outputFolder)
|
||
|
artifact: '$(osName)Backend'
|
||
|
displayName: Publish Backend
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||
|
- publish: $(testsFolder)
|
||
|
artifact: '$(osName)Tests'
|
||
|
displayName: Publish Test Package
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||
|
|
||
|
- stage: Build_Frontend
|
||
|
displayName: Build Frontend
|
||
|
dependsOn: []
|
||
|
|
||
|
jobs:
|
||
|
- job: Frontend
|
||
|
strategy:
|
||
|
matrix:
|
||
|
Linux:
|
||
|
osName: 'Linux'
|
||
|
imageName: 'ubuntu-18.04'
|
||
|
Mac:
|
||
|
osName: 'Mac'
|
||
|
imageName: 'macos-10.14'
|
||
|
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
|
||
|
- bash: ./build.sh --only-frontend
|
||
|
displayName: Build Radarr Frontend
|
||
|
env:
|
||
|
FORCE_COLOR: 0
|
||
|
- publish: $(outputFolder)
|
||
|
artifact: '$(osName)Frontend'
|
||
|
displayName: Publish Frontend
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||
|
|
||
|
- stage: Package
|
||
|
dependsOn:
|
||
|
- Build_Backend
|
||
|
- Build_Frontend
|
||
|
jobs:
|
||
|
- job: Windows_Installer
|
||
|
displayName: Create Installer
|
||
|
pool:
|
||
|
vmImage: 'windows-2019'
|
||
|
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
|
||
|
- bash: ./build.sh --only-packages
|
||
|
displayName: Create Packages
|
||
|
- bash: |
|
||
|
./setup/inno/ISCC.exe "./setup/radarr.iss"
|
||
|
cp ./setup/output/Radarr.*windows.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/${WINDOWSINSTALLER}
|
||
|
displayName: Create Windows installer
|
||
|
- publish: $(Build.ArtifactStagingDirectory)
|
||
|
artifact: 'WindowsInstaller'
|
||
|
displayName: Publish Installer
|
||
|
|
||
|
- job: Other_Packages
|
||
|
displayName: Create Standard Packages
|
||
|
pool:
|
||
|
vmImage: 'ubuntu-18.04'
|
||
|
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
|
||
|
- bash: ./build.sh --only-packages
|
||
|
displayName: Create Packages
|
||
|
- bash: |
|
||
|
chmod a+x $(artifactsFolder)/macos/Radarr/Radarr
|
||
|
chmod a+x $(artifactsFolder)/macos-app/Radarr.app/Contents/MacOS/Radarr
|
||
|
displayName: Set Mac executable bits
|
||
|
- task: ArchiveFiles@2
|
||
|
displayName: Create Windows zip
|
||
|
inputs:
|
||
|
archiveFile: '$(Build.ArtifactStagingDirectory)/$(windowsZip)'
|
||
|
archiveType: 'zip'
|
||
|
includeRootFolder: false
|
||
|
rootFolderOrFile: $(artifactsFolder)/windows
|
||
|
- task: ArchiveFiles@2
|
||
|
displayName: Create MacOS app
|
||
|
inputs:
|
||
|
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsApp)'
|
||
|
archiveType: 'zip'
|
||
|
includeRootFolder: false
|
||
|
rootFolderOrFile: $(artifactsFolder)/macos-app
|
||
|
- task: ArchiveFiles@2
|
||
|
displayName: Create MacOS tar
|
||
|
inputs:
|
||
|
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsTar)'
|
||
|
archiveType: 'tar'
|
||
|
tarCompression: 'gz'
|
||
|
includeRootFolder: false
|
||
|
rootFolderOrFile: $(artifactsFolder)/macos
|
||
|
- task: ArchiveFiles@2
|
||
|
displayName: Create Linux tar
|
||
|
inputs:
|
||
|
archiveFile: '$(Build.ArtifactStagingDirectory)/$(linuxTar)'
|
||
|
archiveType: 'tar'
|
||
|
tarCompression: 'gz'
|
||
|
includeRootFolder: false
|
||
|
rootFolderOrFile: $(artifactsFolder)/linux
|
||
|
- publish: $(Build.ArtifactStagingDirectory)
|
||
|
artifact: 'Packages'
|
||
|
displayName: Publish Packages
|
||
|
|
||
|
- stage: Unit_Test
|
||
|
displayName: Unit Tests
|
||
|
dependsOn: Build_Backend
|
||
|
condition: succeeded()
|
||
|
jobs:
|
||
|
- job: Unit
|
||
|
strategy:
|
||
|
matrix:
|
||
|
Linux:
|
||
|
osName: 'Linux'
|
||
|
imageName: 'ubuntu-18.04'
|
||
|
Mac:
|
||
|
osName: 'Mac'
|
||
|
imageName: 'macos-10.14'
|
||
|
Windows:
|
||
|
osName: 'Windows'
|
||
|
imageName: 'windows-2019'
|
||
|
|
||
|
pool:
|
||
|
vmImage: $(imageName)
|
||
|
|
||
|
steps:
|
||
|
- checkout: none
|
||
|
- task: DownloadPipelineArtifact@2
|
||
|
displayName: Download Test Artifact
|
||
|
inputs:
|
||
|
buildType: 'current'
|
||
|
artifactName: WindowsTests
|
||
|
targetPath: $(testsFolder)
|
||
|
- bash: |
|
||
|
wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-11_all.deb
|
||
|
sudo dpkg -i repo-mediaarea_1.0-11_all.deb
|
||
|
sudo apt-get update
|
||
|
sudo apt-get install -y --allow-unauthenticated libmediainfo-dev libmediainfo0v5 mediainfo
|
||
|
displayName: Install mediainfo
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||
|
- powershell: Set-Service SCardSvr -StartupType Manual
|
||
|
displayName: Enable Windows Test Service
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||
|
- bash: |
|
||
|
chmod a+x ${TESTSFOLDER}/test.sh
|
||
|
${TESTSFOLDER}/test.sh ${OSNAME} Unit Test
|
||
|
displayName: Run Unit Tests
|
||
|
- publish: TestResult.xml
|
||
|
artifact: 'TestResult'
|
||
|
displayName: Publish Test Result
|
||
|
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||
|
- task: PublishTestResults@2
|
||
|
displayName: Publish Test Results
|
||
|
inputs:
|
||
|
testResultsFormat: 'NUnit'
|
||
|
testResultsFiles: '**/TestResult.xml'
|
||
|
testRunTitle: '$(osName) Unit Tests'
|
||
|
failTaskOnFailedTests: true
|
||
|
|
||
|
- stage: Integration
|
||
|
displayName: Integration
|
||
|
dependsOn: Package
|
||
|
|
||
|
jobs:
|
||
|
|
||
|
- job: Integration
|
||
|
strategy:
|
||
|
matrix:
|
||
|
Linux:
|
||
|
osName: 'Linux'
|
||
|
imageName: 'ubuntu-18.04'
|
||
|
pattern: 'Radarr.**.linux.tar.gz'
|
||
|
Mac:
|
||
|
osName: 'Mac'
|
||
|
imageName: 'macos-10.14'
|
||
|
pattern: 'Radarr.**.osx.tar.gz'
|
||
|
Windows:
|
||
|
osName: 'Windows'
|
||
|
imageName: 'windows-2019'
|
||
|
pattern: 'Radarr.**.windows.zip'
|
||
|
|
||
|
pool:
|
||
|
vmImage: $(imageName)
|
||
|
|
||
|
steps:
|
||
|
- bash: |
|
||
|
SYMLINK=5_18_1
|
||
|
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'))
|
||
|
- checkout: none
|
||
|
- task: DownloadPipelineArtifact@2
|
||
|
displayName: Download Test Artifact
|
||
|
inputs:
|
||
|
buildType: 'current'
|
||
|
artifactName: WindowsTests
|
||
|
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
|
||
|
- bash: |
|
||
|
ls -lR
|
||
|
chmod a+x ${TESTSFOLDER}/test.sh
|
||
|
${TESTSFOLDER}/test.sh ${OSNAME} Integration Test
|
||
|
displayName: Run Integration Tests
|
||
|
- task: PublishTestResults@2
|
||
|
inputs:
|
||
|
testResultsFormat: 'NUnit'
|
||
|
testResultsFiles: '**/TestResult.xml'
|
||
|
testRunTitle: '$(osName) Integration Tests'
|
||
|
failTaskOnFailedTests: true
|
||
|
displayName: Publish Test Results
|
||
|
|
||
|
- stage: Automation
|
||
|
displayName: Automation
|
||
|
dependsOn: Package
|
||
|
|
||
|
jobs:
|
||
|
- job: Automation
|
||
|
strategy:
|
||
|
matrix:
|
||
|
Linux:
|
||
|
osName: 'Linux'
|
||
|
imageName: 'ubuntu-18.04'
|
||
|
pattern: 'Radarr.**.linux.tar.gz'
|
||
|
failBuild: true
|
||
|
Mac:
|
||
|
osName: 'Mac'
|
||
|
imageName: 'macos-10.14' # Fails due to firefox not being installed on image
|
||
|
pattern: 'Radarr.**.osx.tar.gz'
|
||
|
failBuild: true
|
||
|
Windows:
|
||
|
osName: 'Windows'
|
||
|
imageName: 'windows-2019'
|
||
|
pattern: 'Radarr.**.windows.zip'
|
||
|
failBuild: true
|
||
|
|
||
|
pool:
|
||
|
vmImage: $(imageName)
|
||
|
|
||
|
steps:
|
||
|
- checkout: none
|
||
|
- task: DownloadPipelineArtifact@2
|
||
|
displayName: Download Test Artifact
|
||
|
inputs:
|
||
|
buildType: 'current'
|
||
|
artifactName: WindowsTests
|
||
|
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
|
||
|
- bash: |
|
||
|
if [[ $OSNAME == "Mac" ]]; then
|
||
|
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
|
||
|
elif [[ $OSNAME == "Linux" ]]; then
|
||
|
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
|
||
|
else
|
||
|
echo "Unhandled OS"
|
||
|
exit 1
|
||
|
fi
|
||
|
curl -s -L "$url" | tar -xz
|
||
|
chmod +x geckodriver
|
||
|
mv geckodriver _tests
|
||
|
displayName: Install Gecko Driver
|
||
|
condition: and(succeeded(), ne(variables['osName'], 'Windows'))
|
||
|
- bash: ls -lR
|
||
|
- bash: |
|
||
|
chmod a+x ${TESTSFOLDER}/test.sh
|
||
|
${TESTSFOLDER}/test.sh ${OSNAME} Automation
|
||
|
displayName: Run Automation Tests
|
||
|
- task: PublishTestResults@2
|
||
|
inputs:
|
||
|
testResultsFormat: 'NUnit'
|
||
|
testResultsFiles: '**/TestResult.xml'
|
||
|
testRunTitle: '$(osName) Automation Tests'
|
||
|
failTaskOnFailedTests: $(failBuild)
|
||
|
displayName: Publish Test Results
|
||
|
|
||
|
- stage: Report_Out
|
||
|
dependsOn:
|
||
|
- Unit_Test
|
||
|
- Integration
|
||
|
- Automation
|
||
|
condition: eq(variables['system.pullrequest.isfork'], false)
|
||
|
displayName: Build Status Report
|
||
|
jobs:
|
||
|
- job:
|
||
|
displayName: Discord Notification
|
||
|
pool:
|
||
|
vmImage: 'ubuntu-18.04'
|
||
|
steps:
|
||
|
- checkout: none
|
||
|
- powershell: |
|
||
|
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Servarr/AzureDiscordNotify/master/DiscordNotify.ps1'))
|
||
|
env:
|
||
|
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||
|
DISCORDCHANNELID: $(discordChannelId)
|
||
|
DISCORDWEBHOOKKEY: $(discordWebhookKey)
|