parent
b89c7b8675
commit
944f420270
@ -1,14 +0,0 @@
|
||||
FROM mono:5.18
|
||||
|
||||
RUN dpkg --add-architecture i386 && apt-get update && apt-get install -y git ssh tar gzip ca-certificates wget zip wine wine32 wine64 libwine libwine:i386
|
||||
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -E -
|
||||
RUN apt-get install -y nodejs
|
||||
RUN wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-7_all.deb && dpkg -i repo-mediaarea_1.0-7_all.deb && apt-get update
|
||||
RUN apt-get install -y libmediainfo-dev libmediainfo0v5 mediainfo
|
||||
RUN npm i -g npm
|
||||
RUN apt-get install -y python3-pip && pip3 install gitchangelog pystache
|
||||
RUN curl -O https://dl.google.com/go/go1.10.2.linux-amd64.tar.gz && tar xvf go*.tar.gz && chown -R root:root ./go && mv go /usr/local
|
||||
ENV GOPATH=$HOME/work
|
||||
ENV PATH="${PATH}:/usr/local/go/bin:$GOPATH/bin"
|
||||
RUN go get github.com/aktau/github-release
|
||||
RUN npm install -g yarn
|
@ -1,169 +0,0 @@
|
||||
version: 2
|
||||
|
||||
defaults: &defaults
|
||||
docker:
|
||||
- image: gallileo/radarr-cci-primary:5.8.9
|
||||
environment:
|
||||
BUILD_VERSION: 2.0.0
|
||||
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- restore_cache:
|
||||
keys:
|
||||
- source-v1-{{ .Branch }}-{{ .Revision }}
|
||||
- source-v1-{{ .Branch }}-
|
||||
- source-v1-
|
||||
- checkout
|
||||
- run: git submodule update --init --recursive
|
||||
- save_cache:
|
||||
key: source-v1-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
- ".git"
|
||||
- run:
|
||||
name: Patching Assembly Info
|
||||
command: sed -i "s/AssemblyVersion(\".*\")/AssemblyVersion(\"$BUILD_VERSION.$CIRCLE_BUILD_NUM\")/gi" src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs && cat src/NzbDrone.Common/Properties/SharedAssemblyInfo.cs
|
||||
- run:
|
||||
name: Clean Build
|
||||
command: ./build.sh Clean
|
||||
- run:
|
||||
name: Restore Nuget
|
||||
command: ./build.sh NugetMono
|
||||
- run:
|
||||
name: Build
|
||||
command: ./build.sh Build
|
||||
- restore_cache:
|
||||
keys:
|
||||
- v1-npm-deps-{{ checksum "package.json" }}
|
||||
# Find the most recent cache used from any branch
|
||||
- v1-npm-deps-
|
||||
- run:
|
||||
name: Gulp
|
||||
command: ./build.sh Gulp
|
||||
- save_cache:
|
||||
key: v1-npm-deps-{{ checksum "package.json" }}
|
||||
paths:
|
||||
- "node_modules"
|
||||
- run:
|
||||
name: Package
|
||||
command: ./build.sh Package
|
||||
- run:
|
||||
name: Preparing Tests
|
||||
command: mkdir -p _tests/reports/junit && mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
# Must be relative path from root
|
||||
paths:
|
||||
- _output
|
||||
- _output_mono
|
||||
- _output_osx
|
||||
- _output_osx_app
|
||||
- _tests
|
||||
- setup
|
||||
- .circleci
|
||||
- deploy.sh
|
||||
unit_tests:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Preparing Tests
|
||||
command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
||||
- run:
|
||||
name: Unit Tests
|
||||
command: ./_tests/test.sh Linux Unit
|
||||
- store_test_results:
|
||||
path: _tests/reports/
|
||||
|
||||
integration_tests:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: Copy Binaries for Integration Tests
|
||||
command: cp -R _output_mono/ _tests/bin
|
||||
- run:
|
||||
name: Preparing Tests
|
||||
command: mkdir -p ../.config/Radarr && chmod -R 777 ../.config
|
||||
- run:
|
||||
name: Integration Tests
|
||||
command: ./_tests/test.sh Linux Integration
|
||||
- store_test_results:
|
||||
path: _tests/reports/
|
||||
publish_artifacts:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- run:
|
||||
name: "Creating packages"
|
||||
command: |
|
||||
mkdir -p _packages/
|
||||
cp -r _output/ _packages/Radarr
|
||||
zip -r _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.windows.zip _packages/Radarr
|
||||
rm -rf _packages/Radarr
|
||||
cp -r _output_mono/ _packages/Radarr
|
||||
tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.linux.tar.gz -C _packages Radarr
|
||||
rm -rf _packages/Radarr
|
||||
cp -r _output_osx/ _packages/Radarr
|
||||
tar -zcvf _packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx.tar.gz -C _packages Radarr
|
||||
rm -rf _packages/Radarr
|
||||
cd _output_osx_app/
|
||||
zip -r ../_packages/Radarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.osx-app.zip *
|
||||
- run:
|
||||
name: "Creating Installer"
|
||||
command: wine setup/inno/ISCC.exe setup/radarr.iss && cp -r setup/Output/Radarr* _packages/
|
||||
- store_artifacts:
|
||||
path: _packages
|
||||
destination: artifacts
|
||||
#- run:
|
||||
# name: "Deploying"
|
||||
# command: chmod +x deploy.sh && ./deploy.sh
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
# Must be relative path from root
|
||||
paths:
|
||||
- _packages
|
||||
deploy:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: .
|
||||
- restore_cache:
|
||||
keys:
|
||||
- source-v1-{{ .Branch }}-{{ .Revision }}
|
||||
- source-v1-{{ .Branch }}-
|
||||
- source-v1-
|
||||
- checkout
|
||||
- run:
|
||||
name: Creating Release
|
||||
command: export LC_ALL=C.UTF-8 && export changelog=$(GITCHANGELOG_CONFIG_FILENAME=.gitchangelog.rc.release gitchangelog) && echo "Deploying v$BUILD_VERSION.$CIRCLE_BUILD_NUM to Github, with changelog:\n\n$changelog" && github-release release -u Radarr -r Radarr -t "v$BUILD_VERSION" -p --draft -d "$changelog" -n "Pre-Release v$BUILD_VERSION"
|
||||
- run:
|
||||
name: Uploading Assets
|
||||
command: cd _packages && ls Radarr.*.* | xargs -n1 -P0 -I{} -- github-release upload -u Radarr -r Radarr -t "v$BUILD_VERSION.$CIRCLE_BUILD_NUM" --name {} --file {}
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
|
||||
build_and_test:
|
||||
jobs:
|
||||
- build
|
||||
- unit_tests:
|
||||
requires:
|
||||
- build
|
||||
#- integration_tests:
|
||||
# requires:
|
||||
# - build
|
||||
- publish_artifacts:
|
||||
requires:
|
||||
- build
|
||||
#- request_deploy:
|
||||
# type: approval
|
||||
# requires:
|
||||
# - publish_artifacts
|
||||
#- deploy:
|
||||
# requires:
|
||||
# - request_deploy
|
@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" indent="yes"/>
|
||||
|
||||
<xsl:template match="/test-run">
|
||||
<testsuites tests="{@testcasecount}" failures="{@failed}" disabled="{@skipped}" time="{@duration}">
|
||||
<xsl:apply-templates/>
|
||||
</testsuites>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-suite">
|
||||
<xsl:if test="test-case">
|
||||
<testsuite tests="{@testcasecount}" time="{@duration}" errors="{@testcasecount - @passed - @skipped - @failed}" failures="{@failed}" skipped="{@skipped}" timestamp="{@start-time}">
|
||||
<xsl:attribute name="name">
|
||||
<xsl:for-each select="ancestor-or-self::test-suite/@name">
|
||||
<xsl:value-of select="concat(., '.')"/>
|
||||
</xsl:for-each>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates select="test-case"/>
|
||||
</testsuite>
|
||||
<xsl:apply-templates select="test-suite"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="not(test-case)">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-case">
|
||||
<testcase name="{@name}" assertions="{@asserts}" time="{@duration}" status="{@result}" classname="{@classname}">
|
||||
<xsl:if test="@runstate = 'Skipped' or @runstate = 'Ignored'">
|
||||
<skipped/>
|
||||
</xsl:if>
|
||||
|
||||
<xsl:apply-templates/>
|
||||
</testcase>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="command-line"/>
|
||||
<xsl:template match="settings"/>
|
||||
|
||||
<xsl:template match="output">
|
||||
<system-out>
|
||||
<xsl:value-of select="."/>
|
||||
</system-out>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="stack-trace">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-case/failure">
|
||||
<failure message="{./message}">
|
||||
<xsl:value-of select="./stack-trace"/>
|
||||
</failure>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-suite/failure"/>
|
||||
|
||||
<xsl:template match="test-case/reason">
|
||||
<skipped message="{./message}"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-case/assertions">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="test-suite/reason"/>
|
||||
|
||||
<xsl:template match="properties"/>
|
||||
</xsl:stylesheet>
|
||||
|
@ -1,16 +0,0 @@
|
||||
language: csharp
|
||||
solution: src/NzbDrone.sln
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- nodejs
|
||||
# - npm apparently not needed anymore.
|
||||
script:
|
||||
- ./build.sh
|
||||
- chmod +x test.sh
|
||||
# - ./test.sh Linux Unit Takes far too long, maybe even crashes travis :/
|
||||
after_success:
|
||||
- chmod +x package.sh
|
||||
- ./package.sh
|
||||
notifications:
|
||||
- webhooks: https://discordapp.com/api/webhooks/266910310219251712/V-QvCcnYkg3O8PMevcAJOJyCgrYkZQoF2pupLDGbaISNUECmYPd6LRwl3avKHsPyfgWP
|
@ -1,60 +1,3 @@
|
||||
version: '2.0.0.{build}'
|
||||
|
||||
image: Visual Studio 2017
|
||||
|
||||
assembly_info:
|
||||
patch: true
|
||||
file: 'src\NzbDrone.Common\Properties\SharedAssemblyInfo.cs'
|
||||
assembly_version: '{version}'
|
||||
assembly_file_version: '{version}'
|
||||
assembly_informational_version: '{version}-rc1'
|
||||
|
||||
environment:
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
||||
|
||||
install:
|
||||
- git submodule update --init --recursive
|
||||
|
||||
#init:
|
||||
# - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
|
||||
build_script:
|
||||
- ps: ./build-appveyor.ps1
|
||||
|
||||
test: off
|
||||
#test:
|
||||
# assemblies:
|
||||
# - '_tests\*Test.dll'
|
||||
# categories:
|
||||
# except:
|
||||
# - IntegrationTest
|
||||
# - AutomationTest
|
||||
|
||||
artifacts:
|
||||
- path: '_artifacts\*.zip'
|
||||
- path: '_artifacts\*.exe'
|
||||
- path: '_artifacts\*.tar.gz'
|
||||
|
||||
cache:
|
||||
- '%USERPROFILE%\.nuget\packages'
|
||||
- node_modules -> package.json
|
||||
|
||||
pull_requests:
|
||||
do_not_increment_build_number: true
|
||||
|
||||
on_failure:
|
||||
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
|
||||
- ps: Get-ChildItem .\_artifacts\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||
- ps: Get-ChildItem .\_artifacts\*.exe | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||
- ps: Get-ChildItem .\_artifacts\*.tar.gz | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
|
||||
|
||||
only_commits:
|
||||
skip_commits:
|
||||
files:
|
||||
- src/
|
||||
- osx/
|
||||
- gulp/
|
||||
- logo/
|
||||
- setup/
|
||||
- frontend/
|
||||
- appveyor.yml
|
||||
- build-appveyor.cake
|
||||
- '**/**'
|
@ -0,0 +1,485 @@
|
||||
# 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: '2.0.0'
|
||||
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'
|
||||
|
||||
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-16.04'
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
|
||||
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
|
||||
- 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-16.04'
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
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: 'vs2017-win2016'
|
||||
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-16.04'
|
||||
steps:
|
||||
- bash: sudo apt install dos2unix
|
||||
- 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
|
||||
- bash: |
|
||||
echo "Uploading source maps to sentry"
|
||||
curl -sL https://sentry.io/get-cli/ | bash
|
||||
RELEASENAME="${RADARRVERSION}-${BUILD_SOURCEBRANCHNAME}"
|
||||
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
|
||||
sentry-cli releases set-commits --auto "${RELEASENAME}"
|
||||
sentry-cli releases deploys "${RELEASENAME}" new -e nightly
|
||||
displayName: Publish Sentry Source Maps
|
||||
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/develop'))
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: $(sentryAuthToken)
|
||||
SENTRY_ORG: $(sentryOrg)
|
||||
|
||||
- stage: Unit_Test
|
||||
displayName: Unit Tests
|
||||
dependsOn: Build_Backend
|
||||
condition: succeeded()
|
||||
jobs:
|
||||
- job: Unit
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
osName: 'Linux'
|
||||
imageName: 'ubuntu-16.04'
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13'
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
- checkout: none
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download Test Artifact
|
||||
inputs:
|
||||
buildType: 'current'
|
||||
artifactName: WindowsTests
|
||||
targetPath: $(testsFolder)
|
||||
- powershell: Set-Service SCardSvr -StartupType Manual
|
||||
displayName: Enable Windows Test Service
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Windows'))
|
||||
- bash: |
|
||||
sudo apt install dos2unix
|
||||
dos2unix ${TESTSFOLDER}/test.sh
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||
- bash: |
|
||||
brew install dos2unix
|
||||
dos2unix ${TESTSFOLDER}/test.sh
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
|
||||
- task: Bash@3
|
||||
displayName: Run Tests
|
||||
env:
|
||||
DYLD_FALLBACK_LIBRARY_PATH: $(Build.SourcesDirectory)/_tests
|
||||
TEST_DIR: $(Build.SourcesDirectory)/_tests
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(testsFolder)/test.sh'
|
||||
arguments: '$(osName) Unit Test'
|
||||
- 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_Automation
|
||||
displayName: Integration / Automation
|
||||
dependsOn: Package
|
||||
jobs:
|
||||
|
||||
- job: Integration
|
||||
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'
|
||||
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=DYLD_FALLBACK_LIBRARY_PATH;].:$MONOPREFIX/lib:/lib:/usr/lib:$DYLD_LIBRARY_FALLBACK_PATH"
|
||||
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: |
|
||||
sudo apt install dos2unix
|
||||
dos2unix ${TESTSFOLDER}/test.sh
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Linux'))
|
||||
- bash: |
|
||||
brew install dos2unix
|
||||
dos2unix ${TESTSFOLDER}/test.sh
|
||||
condition: and(succeeded(), eq(variables['osName'], 'Mac'))
|
||||
- task: Bash@3
|
||||
displayName: Run Integration Tests
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(testsFolder)/test.sh'
|
||||
arguments: $(osName) Integration Test
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFormat: 'NUnit'
|
||||
testResultsFiles: '**/TestResult.xml'
|
||||
testRunTitle: '$(osName) Integration Tests'
|
||||
failTaskOnFailedTests: true
|
||||
displayName: Publish Test Results
|
||||
|
||||
- job: Automation
|
||||
strategy:
|
||||
matrix:
|
||||
Linux:
|
||||
osName: 'Linux'
|
||||
imageName: 'ubuntu-16.04'
|
||||
pattern: 'Radarr.**.linux.tar.gz'
|
||||
failBuild: true
|
||||
Mac:
|
||||
osName: 'Mac'
|
||||
imageName: 'macos-10.13' # Fails due to firefox not being installed on image
|
||||
pattern: 'Radarr.**.osx.tar.gz'
|
||||
failBuild: false
|
||||
Windows:
|
||||
osName: 'Windows'
|
||||
imageName: 'vs2017-win2016'
|
||||
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.24.0/geckodriver-v0.24.0-macos.tar.gz
|
||||
elif [[ $OSNAME == "Linux" ]]; then
|
||||
url=https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.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
|
||||
- task: Bash@3
|
||||
displayName: Run Automation Tests
|
||||
inputs:
|
||||
targetType: 'filePath'
|
||||
filePath: '$(testsFolder)/test.sh'
|
||||
arguments: $(osName) Automation Test
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFormat: 'NUnit'
|
||||
testResultsFiles: '**/TestResult.xml'
|
||||
testRunTitle: '$(osName) Automation Tests'
|
||||
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
|
||||
|
||||
# - 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
|
@ -1,323 +0,0 @@
|
||||
#addin nuget:?package=Cake.Npm
|
||||
#addin nuget:?package=SharpZipLib
|
||||
#addin nuget:?package=Cake.Compression
|
||||
#addin "Cake.FileHelpers"
|
||||
|
||||
// Build variables
|
||||
var outputFolder = "./_output";
|
||||
var outputFolderMono = outputFolder + "_mono";
|
||||
var outputFolderOsx = outputFolder + "_osx";
|
||||
var outputFolderOsxApp = outputFolderOsx + "_app";
|
||||
var testPackageFolder = "./_tests";
|
||||
var testSearchPattern = "*.Test/bin/x86/Release";
|
||||
var sourceFolder = "./src";
|
||||
var solutionFile = sourceFolder + "/Radarr.sln";
|
||||
var updateFolder = outputFolder + "/Radarr.Update";
|
||||
var updateFolderMono = outputFolderMono + "/Radarr.Update";
|
||||
|
||||
// Artifact variables
|
||||
var artifactsFolder = "./_artifacts";
|
||||
var artifactsFolderWindows = artifactsFolder + "/windows";
|
||||
var artifactsFolderLinux = artifactsFolder + "/linux";
|
||||
var artifactsFolderOsx = artifactsFolder + "/osx";
|
||||
var artifactsFolderOsxApp = artifactsFolder + "/osx-app";
|
||||
|
||||
// Utility methods
|
||||
public void RemoveEmptyFolders(string startLocation) {
|
||||
foreach (var directory in System.IO.Directory.GetDirectories(startLocation))
|
||||
{
|
||||
RemoveEmptyFolders(directory);
|
||||
|
||||
if (System.IO.Directory.GetFiles(directory).Length == 0 &&
|
||||
System.IO.Directory.GetDirectories(directory).Length == 0)
|
||||
{
|
||||
DeleteDirectory(directory, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void CleanFolder(string path, bool keepConfigFiles) {
|
||||
DeleteFiles(path + "/**/*.transform");
|
||||
|
||||
if (!keepConfigFiles) {
|
||||
DeleteFiles(path + "/**/*.dll.config");
|
||||
}
|
||||
|
||||
DeleteFiles(path + "/**/FluentValidation.resources.dll");
|
||||
DeleteFiles(path + "/**/App.config");
|
||||
|
||||
DeleteFiles(path + "/**/*.less");
|
||||
|
||||
DeleteFiles(path + "/**/*.vshost.exe");
|
||||
|
||||
DeleteFiles(path + "/**/*.dylib");
|
||||
|
||||
RemoveEmptyFolders(path);
|
||||
}
|
||||
|
||||
public void CreateMdbs(string path) {
|
||||
foreach (var file in System.IO.Directory.EnumerateFiles(path, "*.pdb", System.IO.SearchOption.AllDirectories)) {
|
||||
var actualFile = file.Substring(0, file.Length - 4);
|
||||
|
||||
if (FileExists(actualFile + ".exe")) {
|
||||
StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings()
|
||||
.WithArguments(args => args.Append(actualFile + ".exe")));
|
||||
}
|
||||
|
||||
if (FileExists(actualFile + ".dll")) {
|
||||
StartProcess("./tools/pdb2mdb/pdb2mdb.exe", new ProcessSettings()
|
||||
.WithArguments(args => args.Append(actualFile + ".dll")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Build Tasks
|
||||
Task("Compile").Does(() => {
|
||||
// Build
|
||||
if (DirectoryExists(outputFolder)) {
|
||||
DeleteDirectory(outputFolder, true);
|
||||
}
|
||||
|
||||
MSBuild(solutionFile, config =>
|
||||
config.UseToolVersion(MSBuildToolVersion.VS2017)
|
||||
.WithTarget("Clean")
|
||||
.SetVerbosity(Verbosity.Minimal));
|
||||
|
||||
NuGetRestore(solutionFile);
|
||||
|
||||
MSBuild(solutionFile, config =>
|
||||
config.UseToolVersion(MSBuildToolVersion.VS2017)
|
||||
.SetPlatformTarget(PlatformTarget.x86)
|
||||
.SetConfiguration("Release")
|
||||
.WithProperty("AllowedReferenceRelatedFileExtensions", new string[] { ".pdb" })
|
||||
.WithTarget("Build")
|
||||
.SetVerbosity(Verbosity.Minimal));
|
||||
|
||||
CleanFolder(outputFolder, false);
|
||||
|
||||
// Add JsonNet
|
||||
DeleteFiles(outputFolder + "/Newtonsoft.Json.*");
|
||||
CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", outputFolder);
|
||||
CopyFiles(sourceFolder + "/packages/Newtonsoft.Json.*/lib/net35/*.dll", updateFolder);
|
||||
|
||||
// Remove Mono stuff
|
||||
DeleteFile(outputFolder + "/Mono.Posix.dll");
|
||||
});
|
||||
|
||||
Task("Gulp").Does(() => {
|
||||
NpmInstall(new NpmInstallSettings {
|
||||
LogLevel = NpmLogLevel.Silent,
|
||||
WorkingDirectory = "./",
|
||||
Production = true
|
||||
});
|
||||
|
||||
NpmRunScript("build");
|
||||
});
|
||||
|
||||
Task("PackageMono").Does(() => {
|
||||
// Start mono package
|
||||
if (DirectoryExists(outputFolderMono)) {
|
||||
DeleteDirectory(outputFolderMono, true);
|
||||
}
|
||||
|
||||
CopyDirectory(outputFolder, outputFolderMono);
|
||||
|
||||
// Create MDBs
|
||||
CreateMdbs(outputFolderMono);
|
||||
|
||||
// Remove PDBs
|
||||
DeleteFiles(outputFolderMono + "/**/*.pdb");
|
||||
|
||||
// Remove service helpers
|
||||
DeleteFiles(outputFolderMono + "/ServiceUninstall.*");
|
||||
DeleteFiles(outputFolderMono + "/ServiceInstall.*");
|
||||
|
||||
// Remove native windows binaries
|
||||
DeleteFiles(outputFolderMono + "/sqlite3.*");
|
||||
DeleteFiles(outputFolderMono + "/MediaInfo.*");
|
||||
|
||||
// Adding Radarr.Core.dll.config (for dllmap)
|
||||
CopyFile(sourceFolder + "/NzbDrone.Core/Radarr.Core.dll.config", outputFolderMono + "/Radarr.Core.dll.config");
|
||||
|
||||
// Adding CurlSharp.dll.config (for dllmap)
|
||||
CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", outputFolderMono + "/CurlSharp.dll.config");
|
||||
|
||||
// Renaming Radarr.Console.exe to Radarr.exe
|
||||
DeleteFiles(outputFolderMono + "/Radarr.exe*");
|
||||
MoveFile(outputFolderMono + "/Radarr.Console.exe", outputFolderMono + "/Radarr.exe");
|
||||
MoveFile(outputFolderMono + "/Radarr.Console.exe.config", outputFolderMono + "/Radarr.exe.config");
|
||||
MoveFile(outputFolderMono + "/Radarr.Console.exe.mdb", outputFolderMono + "/Radarr.exe.mdb");
|
||||
|
||||
// Remove Radarr.Windows.*
|
||||
DeleteFiles(outputFolderMono + "/Radarr.Windows.*");
|
||||
|
||||
// Adding Radarr.Mono to updatePackage
|
||||
CopyFiles(outputFolderMono + "/Radarr.Mono.*", updateFolderMono);
|
||||
});
|
||||
|
||||
Task("PackageOsx").Does(() => {
|
||||
// Start osx package
|
||||
if (DirectoryExists(outputFolderOsx)) {
|
||||
DeleteDirectory(outputFolderOsx, true);
|
||||
}
|
||||
|
||||
CopyDirectory(outputFolderMono, outputFolderOsx);
|
||||
|
||||
// Adding sqlite dylibs
|
||||
CopyFiles(sourceFolder + "/Libraries/Sqlite/*.dylib", outputFolderOsx);
|
||||
|
||||
// Adding MediaInfo dylib
|
||||
CopyFiles(sourceFolder + "/Libraries/MediaInfo/*.dylib", outputFolderOsx);
|
||||
|
||||
// Chmod as executable
|
||||
StartProcess(@"C:\cygwin64\bin\chmod.exe", new ProcessSettings()
|
||||
.WithArguments(args => args
|
||||
.Append("+x")
|
||||
.Append(outputFolderOsx + "/Radarr")));
|
||||
|
||||
// Adding Startup script
|
||||
CopyFile("./osx/Radarr", outputFolderOsx + "/Radarr");
|
||||
});
|
||||
|
||||
Task("PackageOsxApp").Does((ctx) => {
|
||||
// Start osx app package
|
||||
if (DirectoryExists(outputFolderOsxApp)) {
|
||||
DeleteDirectory(outputFolderOsxApp, true);
|
||||
}
|
||||
|
||||
CreateDirectory(outputFolderOsxApp);
|
||||
|
||||
// Copy osx package files
|
||||
CopyDirectory("./osx/Radarr.app", outputFolderOsxApp + "/Radarr.app");
|
||||
CopyDirectory(outputFolderOsx, outputFolderOsxApp + "/Radarr.app/Contents/MacOS");
|
||||
|
||||
// Edit version of osx app
|
||||
ctx.ReplaceTextInFiles(outputFolderOsxApp + "/Radarr.app/Contents/Info.plist", "2.0", ctx.EnvironmentVariable("APPVEYOR_BUILD_VERSION") ?? "unknown");
|
||||
});
|
||||
|
||||
Task("PackageTests").Does(() => {
|
||||
// Start tests package
|
||||
if (DirectoryExists(testPackageFolder)) {
|
||||
DeleteDirectory(testPackageFolder, true);
|
||||
}
|
||||
|
||||
CreateDirectory(testPackageFolder);
|
||||
|
||||
// Copy tests
|
||||
CopyFiles(sourceFolder + "/" + testSearchPattern + "/*", testPackageFolder);
|
||||
foreach (var directory in System.IO.Directory.GetDirectories(sourceFolder, "*.Test")) {
|
||||
var releaseDirectory = directory + "/bin/x86/Release";
|
||||
if (DirectoryExists(releaseDirectory)) {
|
||||
foreach (var releaseSubDirectory in System.IO.Directory.GetDirectories(releaseDirectory)) {
|
||||
Information(System.IO.Path.GetDirectoryName(releaseSubDirectory));
|
||||
CopyDirectory(releaseSubDirectory, testPackageFolder + "/" + System.IO.Path.GetFileName(releaseSubDirectory));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Install NUnit.ConsoleRunner
|
||||
NuGetInstall("NUnit.ConsoleRunner", new NuGetInstallSettings {
|
||||
Version = "3.2.0",
|
||||
OutputDirectory = testPackageFolder
|
||||
});
|
||||
|
||||
// Copy dlls
|
||||
CopyFiles(outputFolder + "/*.dll", testPackageFolder);
|
||||
|
||||
// Copy scripts
|
||||
CopyFiles("./*.sh", testPackageFolder);
|
||||
|
||||
// Create MDBs for tests
|
||||
CreateMdbs(testPackageFolder);
|
||||
|
||||
// Remove config
|
||||
DeleteFiles(testPackageFolder + "/*.log.config");
|
||||
|
||||
// Clean
|
||||
CleanFolder(testPackageFolder, true);
|
||||
|
||||
// Adding Radarr.Core.dll.config (for dllmap)
|
||||
CopyFile(sourceFolder + "/NzbDrone.Core/Radarr.Core.dll.config", testPackageFolder + "/Radarr.Core.dll.config");
|
||||
|
||||
// Adding CurlSharp.dll.config (for dllmap)
|
||||
CopyFile(sourceFolder + "/NzbDrone.Common/CurlSharp.dll.config", testPackageFolder + "/CurlSharp.dll.config");
|
||||
|
||||
// Adding CurlSharp libraries
|
||||
CopyFiles(sourceFolder + "/ExternalModules/CurlSharp/libs/i386/*", testPackageFolder);
|
||||
});
|
||||
|
||||
Task("CleanupWindowsPackage").Does(() => {
|
||||
// Remove mono
|
||||
DeleteFiles(outputFolder + "/Radarr.Mono.*");
|
||||
|
||||
// Adding NzbDrone.Windows to updatePackage
|
||||
CopyFiles(outputFolder + "/Radarr.Windows.*", updateFolder);
|
||||
});
|
||||
|
||||
Task("Build")
|
||||
.IsDependentOn("Compile")
|
||||
.IsDependentOn("Gulp")
|
||||
.IsDependentOn("PackageMono")
|
||||
.IsDependentOn("PackageOsx")
|
||||
.IsDependentOn("PackageOsxApp")
|
||||
.IsDependentOn("PackageTests")
|
||||
.IsDependentOn("CleanupWindowsPackage");
|
||||
|
||||
// Build Artifacts
|
||||
Task("CleanArtifacts").Does(() => {
|
||||
if (DirectoryExists(artifactsFolder)) {
|
||||
DeleteDirectory(artifactsFolder, true);
|
||||
}
|
||||
|
||||
CreateDirectory(artifactsFolder);
|
||||
});
|
||||
|
||||
Task("ArtifactsWindows").Does(() => {
|
||||
CopyDirectory(outputFolder, artifactsFolderWindows + "/Radarr");
|
||||
});
|
||||
|
||||
Task("ArtifactsWindowsInstaller").Does(() => {
|
||||
InnoSetup("./setup/radarr.iss", new InnoSetupSettings {
|
||||
OutputDirectory = artifactsFolder,
|
||||
ToolPath = "./setup/inno/ISCC.exe"
|
||||
});
|
||||
});
|
||||
|
||||
Task("ArtifactsLinux").Does(() => {
|
||||
CopyDirectory(outputFolderMono, artifactsFolderLinux + "/Radarr");
|
||||
});
|
||||
|
||||
Task("ArtifactsOsx").Does(() => {
|
||||
CopyDirectory(outputFolderOsx, artifactsFolderOsx + "/Radarr");
|
||||
});
|
||||
|
||||
Task("ArtifactsOsxApp").Does(() => {
|
||||
CopyDirectory(outputFolderOsxApp, artifactsFolderOsxApp);
|
||||
});
|
||||
|
||||
Task("CompressArtifacts").Does(() => {
|
||||
var prefix = "";
|
||||
|
||||
if (AppVeyor.IsRunningOnAppVeyor) {
|
||||
prefix += AppVeyor.Environment.Repository.Branch.Replace("/", "-") + ".";
|
||||
prefix += AppVeyor.Environment.Build.Version + ".";
|
||||
}
|
||||
|
||||
Zip(artifactsFolderWindows, artifactsFolder + "/Radarr." + prefix + "windows.zip");
|
||||
GZipCompress(artifactsFolderLinux, artifactsFolder + "/Radarr." + prefix + "linux.tar.gz");
|
||||
GZipCompress(artifactsFolderOsx, artifactsFolder + "/Radarr." + prefix + "osx.tar.gz");
|
||||
Zip(artifactsFolderOsxApp, artifactsFolder + "/Radarr." + prefix + "osx-app.zip");
|
||||
});
|
||||
|
||||
Task("Artifacts")
|
||||
.IsDependentOn("CleanArtifacts")
|
||||
.IsDependentOn("ArtifactsWindows")
|
||||
.IsDependentOn("ArtifactsWindowsInstaller")
|
||||
.IsDependentOn("ArtifactsLinux")
|
||||
.IsDependentOn("ArtifactsOsx")
|
||||
.IsDependentOn("ArtifactsOsxApp")
|
||||
.IsDependentOn("CompressArtifacts");
|
||||
|
||||
// Run
|
||||
RunTarget("Build");
|
||||
RunTarget("Artifacts");
|
@ -1,189 +0,0 @@
|
||||
##########################################################################
|
||||
# This is the Cake bootstrapper script for PowerShell.
|
||||
# This file was downloaded from https://github.com/cake-build/resources
|
||||
# Feel free to change this file to fit your needs.
|
||||
##########################################################################
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
This is a Powershell script to bootstrap a Cake build.
|
||||
.DESCRIPTION
|
||||
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
|
||||
and execute your Cake build script with the parameters you provide.
|
||||
.PARAMETER Script
|
||||
The build script to execute.
|
||||
.PARAMETER Target
|
||||
The build script target to run.
|
||||
.PARAMETER Configuration
|
||||
The build configuration to use.
|
||||
.PARAMETER Verbosity
|
||||
Specifies the amount of information to be displayed.
|
||||
.PARAMETER Experimental
|
||||
Tells Cake to use the latest Roslyn release.
|
||||
.PARAMETER WhatIf
|
||||
Performs a dry run of the build script.
|
||||
No tasks will be executed.
|
||||
.PARAMETER Mono
|
||||
Tells Cake to use the Mono scripting engine.
|
||||
.PARAMETER SkipToolPackageRestore
|
||||
Skips restoring of packages.
|
||||
.PARAMETER ScriptArgs
|
||||
Remaining arguments are added here.
|
||||
.LINK
|
||||
http://cakebuild.net
|
||||
#>
|
||||
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
[string]$Script = "build-appveyor.cake",
|
||||
[string]$Target = "Default",
|
||||
[ValidateSet("Release", "Debug")]
|
||||
[string]$Configuration = "Release",
|
||||
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
|
||||
[string]$Verbosity = "Verbose",
|
||||
[switch]$Experimental,
|
||||
[Alias("DryRun","Noop")]
|
||||
[switch]$WhatIf,
|
||||
[switch]$Mono,
|
||||
[switch]$SkipToolPackageRestore,
|
||||
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
|
||||
[string[]]$ScriptArgs
|
||||
)
|
||||
|
||||
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
|
||||
function MD5HashFile([string] $filePath)
|
||||
{
|
||||
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
|
||||
{
|
||||
return $null
|
||||
}
|
||||
|
||||
[System.IO.Stream] $file = $null;
|
||||
[System.Security.Cryptography.MD5] $md5 = $null;
|
||||
try
|
||||
{
|
||||
$md5 = [System.Security.Cryptography.MD5]::Create()
|
||||
$file = [System.IO.File]::OpenRead($filePath)
|
||||
return [System.BitConverter]::ToString($md5.ComputeHash($file))
|
||||
}
|
||||
finally
|
||||
{
|
||||
if ($file -ne $null)
|
||||
{
|
||||
$file.Dispose()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Preparing to run build script..."
|
||||
|
||||
if(!$PSScriptRoot){
|
||||
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
|
||||
}
|
||||
|
||||
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
|
||||
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget/nuget.exe"
|
||||
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
|
||||
$NUGET_URL = "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe"
|
||||
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
|
||||
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
|
||||
|
||||
# Should we use mono?
|
||||
$UseMono = "";
|
||||
if($Mono.IsPresent) {
|
||||
Write-Verbose -Message "Using the Mono based scripting engine."
|
||||
$UseMono = "-mono"
|
||||
}
|
||||
|
||||
# Should we use the new Roslyn?
|
||||
$UseExperimental = "";
|
||||
if($Experimental.IsPresent -and !($Mono.IsPresent)) {
|
||||
Write-Verbose -Message "Using experimental version of Roslyn."
|
||||
$UseExperimental = "-experimental"
|
||||
}
|
||||
|
||||
# Is this a dry run?
|
||||
$UseDryRun = "";
|
||||
if($WhatIf.IsPresent) {
|
||||
$UseDryRun = "-dryrun"
|
||||
}
|
||||
|
||||
# Make sure tools folder exists
|
||||
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
|
||||
Write-Verbose -Message "Creating tools directory..."
|
||||
New-Item -Path $TOOLS_DIR -Type directory | out-null
|
||||
}
|
||||
|
||||
# Make sure that packages.config exist.
|
||||
if (!(Test-Path $PACKAGES_CONFIG)) {
|
||||
Write-Verbose -Message "Downloading packages.config..."
|
||||
try { (New-Object System.Net.WebClient).DownloadFile("http://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG) } catch {
|
||||
Throw "Could not download packages.config."
|
||||
}
|
||||
}
|
||||
|
||||
# Try find NuGet.exe in path if not exists
|
||||
if (!(Test-Path $NUGET_EXE)) {
|
||||
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
|
||||
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_) }
|
||||
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
|
||||
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
|
||||
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
|
||||
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
|
||||
}
|
||||
}
|
||||
|
||||
# Try download NuGet.exe if not exists
|
||||
if (!(Test-Path $NUGET_EXE)) {
|
||||
Write-Verbose -Message "Downloading NuGet.exe..."
|
||||
try {
|
||||
(New-Object System.Net.WebClient).DownloadFile($NUGET_URL, $NUGET_EXE)
|
||||
} catch {
|
||||
Throw "Could not download NuGet.exe."
|
||||
}
|
||||
}
|
||||
|
||||
# Save nuget.exe path to environment to be available to child processed
|
||||
$ENV:NUGET_EXE = $NUGET_EXE
|
||||
|
||||
# Restore tools from NuGet?
|
||||
if(-Not $SkipToolPackageRestore.IsPresent) {
|
||||
Push-Location
|
||||
Set-Location $TOOLS_DIR
|
||||
|
||||
# Check for changes in packages.config and remove installed tools if true.
|
||||
[string] $md5Hash = MD5HashFile($PACKAGES_CONFIG)
|
||||
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
|
||||
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
|
||||
Write-Verbose -Message "Missing or changed package.config hash..."
|
||||
Get-ChildItem -Path $TOOLS_DIR -Recurse -Exclude packages.config |
|
||||
Select -ExpandProperty FullName |
|
||||
Where {$_ -notlike (Join-Path $TOOLS_DIR "pdb2mdb*")} |
|
||||
Where {$_ -notlike (Join-Path $TOOLS_DIR "nuget*")} |
|
||||
sort length -Descending |
|
||||
Remove-Item -Recurse
|
||||
}
|
||||
|
||||
Write-Verbose -Message "Restoring tools from NuGet..."
|
||||
$NuGetOutput = Invoke-Expression "&`"$NUGET_EXE`" install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Throw "An error occured while restoring NuGet tools."
|
||||
}
|
||||
else
|
||||
{
|
||||
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
|
||||
}
|
||||
Write-Verbose -Message ($NuGetOutput | out-string)
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
# Make sure that Cake has been installed.
|
||||
if (!(Test-Path $CAKE_EXE)) {
|
||||
Throw "Could not find Cake.exe at $CAKE_EXE"
|
||||
}
|
||||
|
||||
# Start Cake
|
||||
Write-Host "Running build script..."
|
||||
Invoke-Expression "& `"$CAKE_EXE`" `"$Script`" -target=`"$Target`" -configuration=`"$Configuration`" -verbosity=`"$Verbosity`" $UseMono $UseDryRun $UseExperimental $ScriptArgs"
|
||||
exit $LASTEXITCODE
|
@ -1 +0,0 @@
|
||||
Write-Warning "DEPRECATED -- Please use build.sh instead."
|
@ -1,7 +0,0 @@
|
||||
if [ -z "$CIRCLE_PULL_REQUEST" ]; then
|
||||
echo "We are building a normal branch, deploying as such..."
|
||||
curl "http://pr.radarr.video:4466/deploy?url=https%3A%2F%2F${CIRCLE_BUILD_NUM}-77323220-gh.circle-artifacts.com%2F0%2Fartifacts%2FRadarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.linux.tar.gz&b=branch&name=${CIRCLE_BRANCH}"
|
||||
else
|
||||
echo "We are building a pr, deploying as such..."
|
||||
curl "http://pr.radarr.video:4466/deploy?url=https%3A%2F%2F${CIRCLE_BUILD_NUM}-77323220-gh.circle-artifacts.com%2F0%2Fartifacts%2FRadarr.${CIRCLE_BRANCH//\//-}.$BUILD_VERSION.$CIRCLE_BUILD_NUM.linux.tar.gz&b=pr&name=${CIRCLE_PR_NUMBER}"
|
||||
fi
|
@ -1,77 +0,0 @@
|
||||
if [ $# -eq 0 ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
|
||||
echo "Need to supply version argument" && exit;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Use mono or .net depending on OS
|
||||
case "$(uname -s)" in
|
||||
CYGWIN*|MINGW32*|MINGW64*|MSYS*)
|
||||
# on windows, use dotnet
|
||||
runtime="dotnet"
|
||||
;;
|
||||
*)
|
||||
# otherwise use mono
|
||||
runtime="mono"
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
||||
VERSION="$(date +%H:%M:%S)"
|
||||
YEAR="$(date +%Y)"
|
||||
MONTH="$(date +%m)"
|
||||
DAY="$(date +%d)"
|
||||
else
|
||||
VERSION=$1
|
||||
BRANCH=$2
|
||||
BRANCH=${BRANCH#refs\/heads\/}
|
||||
BRANCH=${BRANCH//\//-}
|
||||
fi
|
||||
outputFolder='./_output'
|
||||
outputFolderMono='./_output_mono'
|
||||
outputFolderOsx='./_output_osx'
|
||||
outputFolderOsxApp='./_output_osx_app'
|
||||
|
||||
tr -d "\r" < $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr > $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
|
||||
rm $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr
|
||||
chmod +x $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2
|
||||
mv $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr2 $outputFolderOsxApp/Radarr.app/Contents/MacOS/Radarr >& error.log
|
||||
|
||||
if [ $runtime = "dotnet" ] ; then
|
||||
./tools/7zip/7za.exe a Radarr_Windows_$VERSION.zip ./Radarr_Windows_$VERSION/*
|
||||
./tools/7zip/7za.exe a -ttar -so Radarr_Mono_$VERSION.tar ./Radarr_Mono_$VERSION/* | ./tools/7zip/7za.exe a -si Radarr_Mono_$VERSION.tar.gz
|
||||
./tools/7zip/7za.exe a -ttar -so Radarr_OSX_$VERSION.tar ./_output_osx/* | ./tools/7zip/7za.exe a -si Radarr_OSX_$VERSION.tar.gz
|
||||
./tools/7zip/7za.exe a -ttar -so Radarr_OSX_App_$VERSION.tar ./_output_osx_app/* | ./tools/7zip/7za.exe a -si Radarr_OSX_App_$VERSION.tar.gz
|
||||
else
|
||||
cp -r $outputFolder/ Radarr
|
||||
zip -r Radarr.$BRANCH.$VERSION.windows.zip Radarr
|
||||
rm -rf Radarr
|
||||
cp -r $outputFolderMono/ Radarr
|
||||
tar -zcvf Radarr.$BRANCH.$VERSION.linux.tar.gz Radarr
|
||||
rm -rf Radarr
|
||||
cp -r $outputFolderOsx/ Radarr
|
||||
tar -zcvf Radarr.$BRANCH.$VERSION.osx.tar.gz Radarr
|
||||
rm -rf Radarr
|
||||
#TODO update for tar.gz
|
||||
|
||||
cd _output_osx_app/
|
||||
zip -r ../Radarr.$BRANCH.$VERSION.osx-app.zip *
|
||||
fi
|
||||
# ftp -n ftp.leonardogalli.ch << END_SCRIPT
|
||||
# passive
|
||||
# quote USER $FTP_USER
|
||||
# quote PASS $FTP_PASS
|
||||
# mkdir builds
|
||||
# cd builds
|
||||
# mkdir $YEAR
|
||||
# cd $YEAR
|
||||
# mkdir $MONTH
|
||||
# cd $MONTH
|
||||
# mkdir $DAY
|
||||
# cd $DAY
|
||||
# binary
|
||||
# put Radarr_Windows_$VERSION.zip
|
||||
# put Radarr_Mono_$VERSION.zip
|
||||
# put Radarr_OSX_$VERSION.zip
|
||||
# quit
|
||||
# END_SCRIPT
|
Binary file not shown.
@ -1,40 +0,0 @@
|
||||
# Available types:
|
||||
# - Unit
|
||||
# - Integration
|
||||
# - Automation
|
||||
|
||||
param([string]$type = "Unit")
|
||||
|
||||
$where = "cat != ManualTest && cat != LINUX"
|
||||
$testDir = "."
|
||||
$testPattern = "*Test.dll"
|
||||
|
||||
$nunit = "nunit3-console.exe"
|
||||
$nunitCommand = $nunit
|
||||
|
||||
if (!(Get-Command $nunit -ErrorAction SilentlyContinue)) {
|
||||
Write-Error "nunit3-console.exe was not found in your PATH, please install https://github.com/nunit/nunit-console/releases."
|
||||
exit
|
||||
}
|
||||
|
||||
switch ($type) {
|
||||
"unit" {
|
||||
$where = $where + " && cat != IntegrationTest && cat != AutomationTest"
|
||||
}
|
||||
"integration" {
|
||||
$where = $where + " && cat == IntegrationTest"
|
||||
}
|
||||
"automation" {
|
||||
$where = $where + " && cat == AutomationTest"
|
||||
}
|
||||
Default {
|
||||
Write-Error "Invalid test type specified."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
$assemblies = (Get-ChildItem -Path $testDir -Filter $testPattern -Recurse -File -Name) -join " "
|
||||
|
||||
$command = $nunitCommand + " --where '" + $where + "' " + $assemblies
|
||||
|
||||
Invoke-Expression $command
|
@ -1,4 +0,0 @@
|
||||
[ViewState]
|
||||
Mode=
|
||||
Vid=
|
||||
FolderType=Documents
|
Loading…
Reference in new issue