mirror of
https://github.com/Radarr/Radarr
synced 2025-01-03 13:54:29 +00:00
Improve pipeline and build
This commit is contained in:
parent
6ef388e258
commit
0b7c00bfe6
5 changed files with 319 additions and 219 deletions
|
@ -11,13 +11,8 @@ variables:
|
|||
minorVersion: $[counter('minorVersion', 2000)]
|
||||
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'
|
||||
sentryOrg: 'radarr'
|
||||
dotnetVersion: '2.2.x'
|
||||
dotnetVersion: '3.0.x'
|
||||
|
||||
trigger:
|
||||
branches:
|
||||
|
@ -45,7 +40,7 @@ stages:
|
|||
imageName: 'macos-10.13'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
imageName: 'windows-2019'
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
@ -57,10 +52,11 @@ stages:
|
|||
submodules: true
|
||||
fetchDepth: 1
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core 2.2'
|
||||
displayName: 'Install .net core 3.0'
|
||||
inputs:
|
||||
version: $(dotnetVersion)
|
||||
- bash: ./build.sh --only-backend
|
||||
condition: ne(variables['osName'], 'Windows')
|
||||
- bash: ./build.sh --backend
|
||||
displayName: Build Radarr Backend
|
||||
- bash: |
|
||||
find ${OUTPUTFOLDER} -type f ! -path "*/publish/*" -exec rm -rf {} \;
|
||||
|
@ -87,11 +83,11 @@ stages:
|
|||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||
|
||||
- stage: Build_Frontend
|
||||
displayName: Build Frontend
|
||||
displayName: Frontend
|
||||
dependsOn: []
|
||||
|
||||
jobs:
|
||||
- job: Frontend
|
||||
- job: Build
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
|
@ -102,7 +98,7 @@ stages:
|
|||
imageName: 'macos-10.13'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
imageName: 'windows-2019'
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
steps:
|
||||
|
@ -113,7 +109,7 @@ stages:
|
|||
- checkout: self
|
||||
submodules: true
|
||||
fetchDepth: 1
|
||||
- bash: ./build.sh --only-frontend
|
||||
- bash: ./build.sh --frontend
|
||||
displayName: Build Radarr Frontend
|
||||
env:
|
||||
FORCE_COLOR: 0
|
||||
|
@ -122,7 +118,7 @@ stages:
|
|||
displayName: Publish Frontend
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||
|
||||
- stage: Package
|
||||
- stage: Installer
|
||||
dependsOn:
|
||||
- Build_Backend
|
||||
- Build_Frontend
|
||||
|
@ -130,7 +126,7 @@ stages:
|
|||
- job: Windows_Installer
|
||||
displayName: Create Installer
|
||||
pool:
|
||||
vmImage: 'vs2017-win2016'
|
||||
vmImage: 'windows-2019'
|
||||
steps:
|
||||
- checkout: self
|
||||
fetchDepth: 1
|
||||
|
@ -146,16 +142,21 @@ stages:
|
|||
artifactName: WindowsFrontend
|
||||
targetPath: _output
|
||||
displayName: Fetch Frontend
|
||||
- bash: ./build.sh --only-packages
|
||||
- bash: ./build.sh --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
|
||||
setup/inno/ISCC.exe setup/radarr.iss //DFramework=net462
|
||||
cp setup/output/Radarr.*windows.net462.exe ${BUILD_ARTIFACTSTAGINGDIRECTORY}/Radarr.${BUILDNAME}.windows-installer.exe
|
||||
displayName: Create .NET 462 Windows installer
|
||||
- publish: $(Build.ArtifactStagingDirectory)
|
||||
artifact: 'WindowsInstaller'
|
||||
displayName: Publish Installer
|
||||
|
||||
|
||||
- stage: Packages
|
||||
dependsOn:
|
||||
- Build_Backend
|
||||
- Build_Frontend
|
||||
jobs:
|
||||
- job: Other_Packages
|
||||
displayName: Create Standard Packages
|
||||
pool:
|
||||
|
@ -175,31 +176,30 @@ stages:
|
|||
artifactName: WindowsFrontend
|
||||
targetPath: _output
|
||||
displayName: Fetch Frontend
|
||||
- bash: ./build.sh --only-packages
|
||||
- bash: ./build.sh --packages
|
||||
displayName: Create Packages
|
||||
- bash: |
|
||||
chmod a+x $(artifactsFolder)/macos/Radarr/Radarr
|
||||
chmod a+x $(artifactsFolder)/macos-app/Radarr.app/Contents/MacOS/Radarr
|
||||
find . -name "Radarr.Console" -exec chmod a+x {} \;
|
||||
displayName: Set Mac executable bits
|
||||
find . -name "Radarr" -exec chmod a+x {} \;
|
||||
find . -name "Radarr.Update" -exec chmod a+x {} \;
|
||||
displayName: Set executable bits
|
||||
- task: ArchiveFiles@2
|
||||
displayName: Create Windows zip
|
||||
inputs:
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(windowsZip)'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).windows.zip'
|
||||
archiveType: 'zip'
|
||||
includeRootFolder: false
|
||||
rootFolderOrFile: $(artifactsFolder)/windows/net462
|
||||
- task: ArchiveFiles@2
|
||||
displayName: Create MacOS app
|
||||
inputs:
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsApp)'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx-app.zip'
|
||||
archiveType: 'zip'
|
||||
includeRootFolder: false
|
||||
rootFolderOrFile: $(artifactsFolder)/macos-app/net462
|
||||
- task: ArchiveFiles@2
|
||||
displayName: Create MacOS tar
|
||||
inputs:
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(macOsTar)'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).osx.tar.gz'
|
||||
archiveType: 'tar'
|
||||
tarCompression: 'gz'
|
||||
includeRootFolder: false
|
||||
|
@ -207,11 +207,11 @@ stages:
|
|||
- task: ArchiveFiles@2
|
||||
displayName: Create Linux tar
|
||||
inputs:
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/$(linuxTar)'
|
||||
archiveFile: '$(Build.ArtifactStagingDirectory)/Radarr.$(buildName).linux.tar.gz'
|
||||
archiveType: 'tar'
|
||||
tarCompression: 'gz'
|
||||
includeRootFolder: false
|
||||
rootFolderOrFile: $(artifactsFolder)/linux/net462
|
||||
rootFolderOrFile: $(artifactsFolder)/linux-x64/net462
|
||||
- publish: $(Build.ArtifactStagingDirectory)
|
||||
artifact: 'Packages'
|
||||
displayName: Publish Packages
|
||||
|
@ -235,30 +235,21 @@ stages:
|
|||
condition: succeeded()
|
||||
jobs:
|
||||
- job: Unit
|
||||
displayName: Unit Native
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
osName: 'Linux'
|
||||
imageName: 'ubuntu-16.04'
|
||||
failBuild: true
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13'
|
||||
failBuild: false
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
failBuild: true
|
||||
imageName: 'windows-2019'
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
- checkout: none
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core 2.2'
|
||||
inputs:
|
||||
version: $(dotnetVersion)
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
inputs:
|
||||
|
@ -270,12 +261,19 @@ stages:
|
|||
sudo dpkg -i repo-mediaarea_1.0-9_all.deb
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libmediainfo-dev libmediainfo0v5 mediainfo
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/x86_64-linux-gnu/libsqlite3.so
|
||||
displayName: Install mediainfo and fix sqlite
|
||||
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: |
|
||||
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'))
|
||||
- bash: find ${TESTSFOLDER} -name "Radarr.Test.Dummy" -exec chmod a+x {} \;
|
||||
displayName: Make Test Dummy Executable
|
||||
- task: Bash@3
|
||||
|
@ -292,28 +290,87 @@ stages:
|
|||
testResultsFormat: 'NUnit'
|
||||
testResultsFiles: '**/TestResult.xml'
|
||||
testRunTitle: '$(osName) Unit Tests'
|
||||
failTaskOnFailedTests: $(failBuild)
|
||||
failTaskOnFailedTests: true
|
||||
|
||||
- stage: Integration_Automation
|
||||
displayName: Integration / Automation
|
||||
dependsOn: Package
|
||||
- job: Unit_Docker
|
||||
displayName: Unit Docker
|
||||
strategy:
|
||||
matrix:
|
||||
mono510:
|
||||
testName: 'Mono 5.10'
|
||||
containerImage: radarr/testimages:mono-5.10
|
||||
mono512:
|
||||
testName: 'Mono 5.12'
|
||||
containerImage: radarr/testimages:mono-5.12
|
||||
mono514:
|
||||
testName: 'Mono 5.14'
|
||||
containerImage: radarr/testimages:mono-5.14
|
||||
mono516:
|
||||
testName: 'Mono 5.16'
|
||||
containerImage: radarr/testimages:mono-5.16
|
||||
mono518:
|
||||
testName: 'Mono 5.18'
|
||||
containerImage: radarr/testimages:mono-5.18
|
||||
mono520:
|
||||
testName: 'Mono 5.20'
|
||||
containerImage: radarr/testimages:mono-5.20
|
||||
mono600:
|
||||
testName: 'Mono 6.0'
|
||||
containerImage: radarr/testimages:mono-6.0
|
||||
mono604:
|
||||
testName: 'Mono 6.4'
|
||||
containerImage: radarr/testimages:mono-6.4
|
||||
mono606:
|
||||
testName: 'Mono 6.6'
|
||||
containerImage: radarr/testimages:mono-6.6
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
|
||||
container: $[ variables['containerImage'] ]
|
||||
|
||||
timeoutInMinutes: 10
|
||||
|
||||
steps:
|
||||
- bash: mono --version
|
||||
displayName: Check Mono version
|
||||
- checkout: none
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
inputs:
|
||||
buildType: 'current'
|
||||
artifactName: LinuxTests
|
||||
targetPath: $(testsFolder)
|
||||
- task: Bash@3
|
||||
displayName: Run Tests
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(testsFolder)/test.sh'
|
||||
arguments: 'Linux Unit Test'
|
||||
- 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
|
||||
jobs:
|
||||
|
||||
- job: Integration_Native
|
||||
displayName: Integration Native
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
osName: 'Linux'
|
||||
imageName: 'ubuntu-16.04'
|
||||
pattern: 'Radarr.**.linux.tar.gz'
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13'
|
||||
pattern: 'Radarr.**.osx.tar.gz'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
imageName: 'windows-2019'
|
||||
pattern: 'Radarr.**.windows.zip'
|
||||
|
||||
pool:
|
||||
|
@ -323,19 +380,11 @@ stages:
|
|||
- bash: |
|
||||
SYMLINK=5_18_1
|
||||
MONOPREFIX=/Library/Frameworks/Mono.framework/Versions/$SYMLINK
|
||||
echo "##vso[task.setvariable variable=DYLD_FALLBACK_LIBRARY_PATH;].:$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
|
||||
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'))
|
||||
- bash: |
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/x86_64-linux-gnu/libsqlite3.so
|
||||
displayName: Fix sqlite
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core 2.2'
|
||||
inputs:
|
||||
version: $(dotnetVersion)
|
||||
- checkout: none
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
|
@ -358,7 +407,6 @@ stages:
|
|||
- bash: |
|
||||
mkdir -p ./bin/
|
||||
cp -r -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Radarr/. ./bin/
|
||||
ls -lR
|
||||
displayName: Move Package Contents
|
||||
- task: Bash@3
|
||||
displayName: Run Integration Tests
|
||||
|
@ -378,31 +426,34 @@ stages:
|
|||
displayName: Integration Docker
|
||||
strategy:
|
||||
matrix:
|
||||
mono504:
|
||||
testName: 'Mono 5.4'
|
||||
containerImage: mono:5.4
|
||||
mono508:
|
||||
testName: 'Mono 5.8'
|
||||
containerImage: mono:5.8
|
||||
mono510:
|
||||
testName: 'Mono 5.10'
|
||||
containerImage: mono:5.10
|
||||
containerImage: radarr/testimages:mono-5.10
|
||||
mono512:
|
||||
testName: 'Mono 5.12'
|
||||
containerImage: mono:5.12
|
||||
containerImage: radarr/testimages:mono-5.12
|
||||
mono514:
|
||||
testName: 'Mono 5.14'
|
||||
containerImage: mono:5.14
|
||||
containerImage: radarr/testimages:mono-5.14
|
||||
mono516:
|
||||
testName: 'Mono 5.16'
|
||||
containerImage: mono:5.16
|
||||
containerImage: radarr/testimages:mono-5.16
|
||||
mono518:
|
||||
testName: 'Mono 5.18'
|
||||
containerImage: mono:5.18
|
||||
containerImage: radarr/testimages:mono-5.18
|
||||
mono520:
|
||||
testName: 'Mono 5.20'
|
||||
containerImage: mono:5.20
|
||||
|
||||
containerImage: radarr/testimages:mono-5.20
|
||||
mono600:
|
||||
testName: 'Mono 6.0'
|
||||
containerImage: radarr/testimages:mono-6.0
|
||||
mono604:
|
||||
testName: 'Mono 6.4'
|
||||
containerImage: radarr/testimages:mono-6.4
|
||||
mono606:
|
||||
testName: 'Mono 6.6'
|
||||
containerImage: radarr/testimages:mono-6.6
|
||||
|
||||
variables:
|
||||
pattern: 'Radarr.**.linux.tar.gz'
|
||||
|
||||
|
@ -410,14 +461,12 @@ stages:
|
|||
vmImage: 'ubuntu-16.04'
|
||||
|
||||
container: $[ variables['containerImage'] ]
|
||||
|
||||
timeoutInMinutes: 15
|
||||
|
||||
steps:
|
||||
- bash: mono --version
|
||||
displayName: Check Mono version
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core 2.2'
|
||||
inputs:
|
||||
version: $(dotnetVersion)
|
||||
- checkout: none
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
|
@ -456,6 +505,11 @@ stages:
|
|||
failTaskOnFailedTests: true
|
||||
displayName: Publish Test Results
|
||||
|
||||
- stage: Automation
|
||||
displayName: Automation
|
||||
dependsOn: Packages
|
||||
|
||||
jobs:
|
||||
- job: Automation
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -471,7 +525,7 @@ stages:
|
|||
failBuild: false
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
imageName: 'windows-2019'
|
||||
pattern: 'Radarr.**.windows.zip'
|
||||
failBuild: true
|
||||
|
||||
|
@ -479,14 +533,6 @@ stages:
|
|||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
- bash: |
|
||||
sudo ln -s /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 /usr/lib/x86_64-linux-gnu/libsqlite3.so
|
||||
displayName: Fix sqlite
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Install .net core 2.2'
|
||||
inputs:
|
||||
version: $(dotnetVersion)
|
||||
- checkout: none
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
|
@ -539,63 +585,97 @@ stages:
|
|||
failTaskOnFailedTests: $(failBuild)
|
||||
displayName: Publish Test Results
|
||||
|
||||
# - stage: Analyze
|
||||
# dependsOn: []
|
||||
# displayName: Analyze
|
||||
# condition: eq(variables['system.pullrequest.isfork'], false)
|
||||
|
||||
# jobs:
|
||||
# # - job: Analyze_Frontend
|
||||
# # displayName: Frontend
|
||||
# # pool:
|
||||
# # vmImage: vs2017-win2016
|
||||
# # 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'
|
||||
# # cliProjectName: 'RadarrUI'
|
||||
# # cliProjectVersion: '$(radarrVersion)'
|
||||
# # cliSources: './frontend'
|
||||
# # - task: SonarCloudAnalyze@1
|
||||
- stage: Analyze
|
||||
dependsOn: []
|
||||
displayName: Analyze
|
||||
|
||||
# - job: Analyze_Backend
|
||||
# displayName: Backend
|
||||
# pool:
|
||||
# vmImage: vs2017-win2016
|
||||
# steps:
|
||||
# - checkout: self # Need history for Sonar analysis
|
||||
# submodules: true
|
||||
# - task: SonarCloudPrepare@1
|
||||
# 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/**
|
||||
# sonar.coverage.exclusions=**/Radarr.Api.V1/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
||||
# sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/_tests/CoverageResults/coverage.opencover.xml
|
||||
# sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
||||
# - bash: ./build.sh --only-backend
|
||||
# displayName: Build Radarr Backend
|
||||
# - task: Bash@3
|
||||
# displayName: Coverage Unit Tests
|
||||
# inputs:
|
||||
# targetType: 'filePath'
|
||||
# filePath: ./test.sh
|
||||
# arguments: Windows Unit Coverage
|
||||
# - task: PublishCodeCoverageResults@1
|
||||
# displayName: Publish Coverage Results
|
||||
# inputs:
|
||||
# codeCoverageTool: 'cobertura'
|
||||
# summaryFileLocation: './_tests/CoverageResults/coverage.cobertura.xml'
|
||||
# # - task: SonarCloudAnalyze@1
|
||||
|
||||
jobs:
|
||||
- job: Lint_Frontend
|
||||
displayName: Lint Frontend
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
osName: 'Linux'
|
||||
imageName: 'ubuntu-16.04'
|
||||
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 --lint
|
||||
displayName: Lint Radarr Frontend
|
||||
env:
|
||||
FORCE_COLOR: 0
|
||||
|
||||
# - job: Analyze_Frontend
|
||||
# displayName: Frontend
|
||||
# condition: eq(variables['system.pullrequest.isfork'], false)
|
||||
# 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'
|
||||
# cliProjectName: 'RadarrUI'
|
||||
# cliProjectVersion: '$(radarrVersion)'
|
||||
# cliSources: './frontend'
|
||||
# - task: SonarCloudAnalyze@1
|
||||
|
||||
# - job: Analyze_Backend
|
||||
# displayName: Backend
|
||||
# condition: eq(variables['system.pullrequest.isfork'], false)
|
||||
# pool:
|
||||
# vmImage: windows-2019
|
||||
# steps:
|
||||
# - checkout: self # Need history for Sonar analysis
|
||||
# submodules: true
|
||||
# - task: UseDotNet@2
|
||||
# displayName: 'Install .net core 3.0'
|
||||
# inputs:
|
||||
# version: $(dotnetVersion)
|
||||
# - task: SonarCloudPrepare@1
|
||||
# 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/**
|
||||
# sonar.coverage.exclusions=**/Radarr.Api.V1/**/*,**/MonoTorrent/**/*,**/Marr.Data/**/*
|
||||
# sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)/_tests/CoverageResults/coverage.opencover.xml
|
||||
# sonar.cs.nunit.reportsPaths=$(Build.SourcesDirectory)/TestResult.xml
|
||||
# - task: DotNetCoreCLI@2
|
||||
# displayName: Build backend
|
||||
# inputs:
|
||||
# command: 'build'
|
||||
# projects: 'src/Radarr.Windows.sln'
|
||||
# - task: Bash@3
|
||||
# displayName: Coverage Unit Tests
|
||||
# inputs:
|
||||
# targetType: 'filePath'
|
||||
# filePath: ./test.sh
|
||||
# arguments: Windows Unit Coverage
|
||||
# - task: PublishCodeCoverageResults@1
|
||||
# displayName: Publish Coverage Results
|
||||
# inputs:
|
||||
# codeCoverageTool: 'cobertura'
|
||||
# summaryFileLocation: './_tests/CoverageResults/coverage.cobertura.xml'
|
||||
# - task: SonarCloudAnalyze@1
|
||||
|
|
149
build.sh
149
build.sh
|
@ -1,25 +1,12 @@
|
|||
#! /bin/bash
|
||||
outputFolder='./_output'
|
||||
testPackageFolder='./_tests/'
|
||||
sourceFolder='./src'
|
||||
slnFile=$sourceFolder/Radarr.sln
|
||||
set -e
|
||||
|
||||
#Artifact variables
|
||||
artifactsFolder="./_artifacts";
|
||||
outputFolder='_output'
|
||||
testPackageFolder='_tests'
|
||||
artifactsFolder="_artifacts";
|
||||
|
||||
nuget='tools/nuget/nuget.exe';
|
||||
|
||||
CheckExitCode()
|
||||
{
|
||||
"$@"
|
||||
local status=$?
|
||||
if [ $status -ne 0 ]; then
|
||||
echo "error with $1" >&2
|
||||
exit 1
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
ProgressStart()
|
||||
{
|
||||
echo "Start '$1'"
|
||||
|
@ -34,8 +21,9 @@ UpdateVersionNumber()
|
|||
{
|
||||
if [ "$RADARRVERSION" != "" ]; then
|
||||
echo "Updating Version Info"
|
||||
sed -i "s/<AssemblyVersion>[0-9.*]\+<\/AssemblyVersion>/<AssemblyVersion>$RADARRVERSION<\/AssemblyVersion>/g" ./src/Directory.Build.props
|
||||
sed -i "s/<AssemblyConfiguration>[\$()A-Za-z-]\+<\/AssemblyConfiguration>/<AssemblyConfiguration>${BUILD_SOURCEBRANCHNAME}<\/AssemblyConfiguration>/g" ./src/Directory.Build.props
|
||||
sed -i'' -e "s/<AssemblyVersion>[0-9.*]\+<\/AssemblyVersion>/<AssemblyVersion>$RADARRVERSION<\/AssemblyVersion>/g" src/Directory.Build.props
|
||||
sed -i'' -e "s/<AssemblyConfiguration>[\$()A-Za-z-]\+<\/AssemblyConfiguration>/<AssemblyConfiguration>${BUILD_SOURCEBRANCHNAME}<\/AssemblyConfiguration>/g" src/Directory.Build.props
|
||||
sed -i'' -e "s/<string>10.0.0.0<\/string>/<string>$RADARRVERSION<\/string>/g" macOS/Radarr.app/Contents/Info.plist
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -59,11 +47,15 @@ CleanFolder()
|
|||
LintUI()
|
||||
{
|
||||
ProgressStart 'ESLint'
|
||||
CheckExitCode yarn lint
|
||||
yarn lint
|
||||
ProgressEnd 'ESLint'
|
||||
|
||||
ProgressStart 'Stylelint'
|
||||
CheckExitCode yarn stylelint
|
||||
if [ "$os" = "windows" ]; then
|
||||
yarn stylelint-windows
|
||||
else
|
||||
yarn stylelint-linux
|
||||
fi
|
||||
ProgressEnd 'Stylelint'
|
||||
}
|
||||
|
||||
|
@ -74,23 +66,30 @@ Build()
|
|||
rm -rf $outputFolder
|
||||
rm -rf $testPackageFolder
|
||||
|
||||
CheckExitCode dotnet clean $slnFile -c Debug
|
||||
CheckExitCode dotnet clean $slnFile -c Release
|
||||
CheckExitCode dotnet msbuild -restore src/Radarr.sln -p:Configuration=Release -t:PublishAllRids
|
||||
if [ $os = "windows" ]; then
|
||||
slnFile=src/Radarr.Windows.sln
|
||||
else
|
||||
slnFile=src/Radarr.Posix.sln
|
||||
fi
|
||||
|
||||
dotnet clean $slnFile -c Debug
|
||||
dotnet clean $slnFile -c Release
|
||||
dotnet msbuild -restore $slnFile -p:Configuration=Release -t:PublishAllRids
|
||||
|
||||
ProgressEnd 'Build'
|
||||
}
|
||||
|
||||
RunGulp()
|
||||
YarnInstall()
|
||||
{
|
||||
ProgressStart 'yarn install'
|
||||
yarn install --frozen-lockfile
|
||||
ProgressEnd 'yarn install'
|
||||
}
|
||||
|
||||
LintUI
|
||||
|
||||
RunGulp()
|
||||
{
|
||||
ProgressStart 'Running gulp'
|
||||
CheckExitCode yarn run build --production
|
||||
yarn run build --production
|
||||
ProgressEnd 'Running gulp'
|
||||
}
|
||||
|
||||
|
@ -115,30 +114,25 @@ PackageFiles()
|
|||
PackageLinux()
|
||||
{
|
||||
local framework="$1"
|
||||
local runtime="$2"
|
||||
|
||||
ProgressStart "Creating Linux Package for $framework"
|
||||
ProgressStart "Creating $runtime Package for $framework"
|
||||
|
||||
local folder=$artifactsFolder/linux/$framework/Radarr
|
||||
local folder=$artifactsFolder/$runtime/$framework/Radarr
|
||||
|
||||
PackageFiles "$folder" $framework $runtime "linux-x64"
|
||||
PackageFiles "$folder" "$framework" "$runtime"
|
||||
|
||||
echo "Removing Service helpers"
|
||||
rm -f $folder/ServiceUninstall.*
|
||||
rm -f $folder/ServiceInstall.*
|
||||
|
||||
echo "Renaming Radarr.Console.exe to Radarr.exe"
|
||||
rm $folder/Radarr.exe*
|
||||
for file in $folder/Radarr.Console.exe*; do
|
||||
mv "$file" "${file//.Console/}"
|
||||
done
|
||||
|
||||
echo "Removing Radarr.Windows"
|
||||
rm $folder/Radarr.Windows.*
|
||||
|
||||
echo "Adding Radarr.Mono to UpdatePackage"
|
||||
cp $folder/Radarr.Mono.* $folder/Radarr.Update
|
||||
|
||||
ProgressEnd "Creating Linux Package for $framework"
|
||||
ProgressEnd "Creating $runtime Package for $framework"
|
||||
}
|
||||
|
||||
PackageMacOS()
|
||||
|
@ -151,19 +145,15 @@ PackageMacOS()
|
|||
|
||||
PackageFiles "$folder" "$framework" "osx-x64"
|
||||
|
||||
echo "Adding Startup script"
|
||||
cp ./macOS/Radarr $folder
|
||||
if [ "$framework" = "net462" ]; then
|
||||
echo "Adding Startup script"
|
||||
cp macOS/Radarr $folder
|
||||
fi
|
||||
|
||||
echo "Removing Service helpers"
|
||||
rm -f $folder/ServiceUninstall.*
|
||||
rm -f $folder/ServiceInstall.*
|
||||
|
||||
echo "Renaming Radarr.Console.exe to Radarr.exe"
|
||||
rm $folder/Radarr.exe*
|
||||
for file in $folder/Radarr.Console.exe*; do
|
||||
mv "$file" "${file//.Console/}"
|
||||
done
|
||||
|
||||
echo "Removing Radarr.Windows"
|
||||
rm $folder/Radarr.Windows.*
|
||||
|
||||
|
@ -183,7 +173,7 @@ PackageMacOSApp()
|
|||
|
||||
rm -rf $folder
|
||||
mkdir -p $folder
|
||||
cp -r ./macOS/Radarr.app $folder
|
||||
cp -r macOS/Radarr.app $folder
|
||||
mkdir -p $folder/Radarr.app/Contents/MacOS
|
||||
|
||||
echo "Copying Binaries"
|
||||
|
@ -199,9 +189,9 @@ PackageTests()
|
|||
{
|
||||
ProgressStart 'Creating Test Package'
|
||||
|
||||
cp ./test.sh $testPackageFolder/net462/win-x64/publish
|
||||
cp ./test.sh $testPackageFolder/net462/linux-x64/publish
|
||||
cp ./test.sh $testPackageFolder/net462/osx-x64/publish
|
||||
cp test.sh $testPackageFolder/net462/win-x64/publish
|
||||
cp test.sh $testPackageFolder/net462/linux-x64/publish
|
||||
cp test.sh $testPackageFolder/net462/osx-x64/publish
|
||||
|
||||
if [ $os = "windows" ] ; then
|
||||
$nuget install NUnit.ConsoleRunner -Version 3.10.0 -Output $testPackageFolder/net462/win-x64/publish
|
||||
|
@ -233,7 +223,7 @@ PackageWindows()
|
|||
|
||||
local folder=$artifactsFolder/windows/$framework/Radarr
|
||||
|
||||
PackageFiles "$folder" "net462" "win-x64"
|
||||
PackageFiles "$folder" "$framework" "win-x64"
|
||||
|
||||
echo "Removing Radarr.Mono"
|
||||
rm -f $folder/Radarr.Mono.*
|
||||
|
@ -257,21 +247,41 @@ case "$(uname -s)" in
|
|||
esac
|
||||
|
||||
POSITIONAL=()
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "No arguments provided, building everything"
|
||||
BACKEND=YES
|
||||
FRONTEND=YES
|
||||
PACKAGES=YES
|
||||
LINT=YES
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
--only-backend)
|
||||
ONLY_BACKEND=YES
|
||||
--backend)
|
||||
BACKEND=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--only-frontend)
|
||||
ONLY_FRONTEND=YES
|
||||
--frontend)
|
||||
FRONTEND=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--only-packages)
|
||||
ONLY_PACKAGES=YES
|
||||
--packages)
|
||||
PACKAGES=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--lint)
|
||||
LINT=YES
|
||||
shift # past argument
|
||||
;;
|
||||
--all)
|
||||
BACKEND=YES
|
||||
FRONTEND=YES
|
||||
PACKAGES=YES
|
||||
LINT=YES
|
||||
shift # past argument
|
||||
;;
|
||||
*) # unknown option
|
||||
|
@ -282,25 +292,34 @@ esac
|
|||
done
|
||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
||||
|
||||
# Only build backend if we haven't set only-frontend or only-packages
|
||||
if [ -z "$ONLY_FRONTEND" ] && [ -z "$ONLY_PACKAGES" ];
|
||||
if [ "$BACKEND" = "YES" ];
|
||||
then
|
||||
UpdateVersionNumber
|
||||
Build
|
||||
PackageTests
|
||||
fi
|
||||
|
||||
# Only build frontend if we haven't set only-backend or only-packages
|
||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_PACKAGES" ];
|
||||
if [ "$FRONTEND" = "YES" ];
|
||||
then
|
||||
RunGulp
|
||||
YarnInstall
|
||||
RunGulp
|
||||
fi
|
||||
|
||||
# Only package if we haven't set only-backend or only-frontend
|
||||
if [ -z "$ONLY_BACKEND" ] && [ -z "$ONLY_FRONTEND" ];
|
||||
if [ "$LINT" = "YES" ];
|
||||
then
|
||||
if [ -z "$FRONTEND" ];
|
||||
then
|
||||
YarnInstall
|
||||
fi
|
||||
|
||||
LintUI
|
||||
fi
|
||||
|
||||
if [ "$PACKAGES" = "YES" ];
|
||||
then
|
||||
UpdateVersionNumber
|
||||
PackageWindows "net462"
|
||||
PackageLinux "net462"
|
||||
PackageLinux "net462" "linux-x64"
|
||||
PackageMacOS "net462"
|
||||
PackageMacOSApp "net462"
|
||||
fi
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
"clean": "git clean -fXd",
|
||||
"lint": "esprint check",
|
||||
"lint-fix": "eslint start --fix",
|
||||
"stylelint": "stylelint frontend/**/*.css --config frontend/.stylelintrc"
|
||||
"stylelint-linux": "stylelint $(find frontend -name '*.css') --config frontend/.stylelintrc",
|
||||
"stylelint-windows": "stylelint frontend/**/*.css --config frontend/.stylelintrc"
|
||||
},
|
||||
"repository": "https://github.com/Radarr/Radarr",
|
||||
"author": "Team Radarr",
|
||||
|
|
|
@ -26,7 +26,7 @@ DefaultDirName={commonappdata}\Radarr\bin
|
|||
DisableDirPage=yes
|
||||
DefaultGroupName={#AppName}
|
||||
DisableProgramGroupPage=yes
|
||||
OutputBaseFilename=Radarr.{#BranchName}.{#BuildVersion}.windows
|
||||
OutputBaseFilename=Radarr.{#BranchName}.{#BuildVersion}.windows.{#Framework}
|
||||
SolidCompression=yes
|
||||
AppCopyright=Creative Commons 3.0 License
|
||||
AllowUNCPath=False
|
||||
|
@ -36,6 +36,7 @@ CompressionThreads=2
|
|||
Compression=lzma2/normal
|
||||
AppContact={#ForumsURL}
|
||||
VersionInfoVersion={#BaseVersion}.{#BuildNumber}
|
||||
SetupLogging=yes
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
|
@ -47,8 +48,8 @@ Name: "startupShortcut"; Description: "Create shortcut in Startup folder (Starts
|
|||
Name: "none"; Description: "Do not start automatically"; GroupDescription: "Start automatically"; Flags: exclusive unchecked
|
||||
|
||||
[Files]
|
||||
Source: "..\_artifacts\windows\net462\Radarr\Radarr.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\_artifacts\windows\net462\Radarr\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
Source: "..\_artifacts\windows\{#Framework}\Radarr\Radarr.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
Source: "..\_artifacts\windows\{#Framework}\Radarr\*"; Excludes: "Radarr.Update"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Icons]
|
||||
|
|
5
test.sh
5
test.sh
|
@ -29,10 +29,9 @@ NUNIT_PARAMS="--workers=1"
|
|||
|
||||
if [ "$PLATFORM" = "Mac" ]; then
|
||||
|
||||
export DYLD_FALLBACK_LIBRARY_PATH="$TEST_DIR:/usr/local/lib:/lib:/usr/lib"
|
||||
echo $LD_LIBRARY_PATH
|
||||
echo $DYLD_LIBRARY_PATH
|
||||
export DYLD_FALLBACK_LIBRARY_PATH="$TEST_DIR:$MONOPREFIX/lib:/usr/local/lib:/lib:/usr/lib"
|
||||
echo $DYLD_FALLBACK_LIBRARY_PATH
|
||||
mono --version
|
||||
|
||||
# To debug which libraries are being loaded:
|
||||
# export DYLD_PRINT_LIBRARIES=YES
|
||||
|
|
Loading…
Reference in a new issue