2020-06-19 13:25:11 -07:00
|
|
|
jobs:
|
|
|
|
- job: BuildPackage
|
|
|
|
displayName: 'Build Packages'
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
CentOS.amd64:
|
|
|
|
BuildConfiguration: centos.amd64
|
|
|
|
Fedora.amd64:
|
|
|
|
BuildConfiguration: fedora.amd64
|
|
|
|
Debian.amd64:
|
|
|
|
BuildConfiguration: debian.amd64
|
|
|
|
Debian.arm64:
|
|
|
|
BuildConfiguration: debian.arm64
|
|
|
|
Debian.armhf:
|
|
|
|
BuildConfiguration: debian.armhf
|
|
|
|
Ubuntu.amd64:
|
|
|
|
BuildConfiguration: ubuntu.amd64
|
|
|
|
Ubuntu.arm64:
|
|
|
|
BuildConfiguration: ubuntu.arm64
|
|
|
|
Ubuntu.armhf:
|
|
|
|
BuildConfiguration: ubuntu.armhf
|
|
|
|
Linux.amd64:
|
|
|
|
BuildConfiguration: linux.amd64
|
|
|
|
Windows.amd64:
|
|
|
|
BuildConfiguration: windows.amd64
|
|
|
|
MacOS:
|
|
|
|
BuildConfiguration: macos
|
|
|
|
Portable:
|
|
|
|
BuildConfiguration: portable
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-server-$(BuildConfiguration) deployment'
|
|
|
|
displayName: 'Build Dockerfile'
|
|
|
|
|
|
|
|
- script: 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="yes" -e BUILD_ID=$(Build.BuildNumber) jellyfin-server-$(BuildConfiguration)'
|
|
|
|
displayName: 'Run Dockerfile (unstable)'
|
2020-06-20 12:03:25 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
2020-06-19 13:25:11 -07:00
|
|
|
|
|
|
|
- script: 'docker image ls -a && docker run -v $(pwd)/deployment/dist:/dist -v $(pwd):/jellyfin -e IS_UNSTABLE="no" -e BUILD_ID=$(Build.BuildNumber) jellyfin-server-$(BuildConfiguration)'
|
|
|
|
displayName: 'Run Dockerfile (stable)'
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 'Publish Release'
|
|
|
|
inputs:
|
|
|
|
targetPath: '$(Build.SourcesDirectory)/deployment/dist'
|
|
|
|
artifactName: 'jellyfin-server-$(BuildConfiguration)'
|
|
|
|
|
2020-07-13 11:36:07 -07:00
|
|
|
- task: SSH@0
|
|
|
|
displayName: 'Create target directory on repository server'
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
runOptions: 'inline'
|
|
|
|
inline: 'mkdir -p /srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
|
|
|
|
|
2020-06-19 13:25:11 -07:00
|
|
|
- task: CopyFilesOverSSH@0
|
|
|
|
displayName: 'Upload artifacts to repository server'
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
|
|
|
|
contents: '**'
|
|
|
|
targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
|
|
|
|
|
|
|
|
- job: BuildDocker
|
|
|
|
displayName: 'Build Docker'
|
|
|
|
|
2020-06-19 14:20:48 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-06-19 14:33:07 -07:00
|
|
|
amd64:
|
2020-06-19 14:20:48 -07:00
|
|
|
BuildConfiguration: amd64
|
2020-06-19 14:33:07 -07:00
|
|
|
arm64:
|
2020-06-19 14:20:48 -07:00
|
|
|
BuildConfiguration: arm64
|
2020-06-19 14:33:07 -07:00
|
|
|
armhf:
|
2020-06-19 14:20:48 -07:00
|
|
|
BuildConfiguration: armhf
|
|
|
|
|
2020-06-19 13:25:11 -07:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
2020-07-27 18:35:57 -07:00
|
|
|
variables:
|
|
|
|
- name: JellyfinVersion
|
|
|
|
value: 0.0.0
|
|
|
|
|
2020-06-19 13:25:11 -07:00
|
|
|
steps:
|
2020-07-27 21:21:30 -07:00
|
|
|
- script: echo "##vso[task.setvariable variable=JellyfinVersion]$( awk -F '/' '{ print $NF }' <<<'$(Build.SourceBranch)' | sed 's/^v//' )"
|
2020-07-27 18:35:57 -07:00
|
|
|
displayName: Set release version (stable)
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
|
2020-06-19 13:25:11 -07:00
|
|
|
- task: Docker@2
|
|
|
|
displayName: 'Push Unstable Image'
|
2020-06-20 12:03:25 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
2020-06-19 13:25:11 -07:00
|
|
|
inputs:
|
|
|
|
repository: 'jellyfin/jellyfin-server'
|
|
|
|
command: buildAndPush
|
|
|
|
buildContext: '.'
|
2020-06-19 14:20:48 -07:00
|
|
|
Dockerfile: 'deployment/Dockerfile.docker.$(BuildConfiguration)'
|
2020-06-19 13:25:11 -07:00
|
|
|
containerRegistry: Docker Hub
|
|
|
|
tags: |
|
2020-06-19 14:20:48 -07:00
|
|
|
unstable-$(Build.BuildNumber)-$(BuildConfiguration)
|
|
|
|
unstable-$(BuildConfiguration)
|
2020-06-19 13:25:11 -07:00
|
|
|
|
|
|
|
- task: Docker@2
|
|
|
|
displayName: 'Push Stable Image'
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
inputs:
|
|
|
|
repository: 'jellyfin/jellyfin-server'
|
|
|
|
command: buildAndPush
|
|
|
|
buildContext: '.'
|
2020-06-19 14:20:48 -07:00
|
|
|
Dockerfile: 'deployment/Dockerfile.docker.$(BuildConfiguration)'
|
2020-06-19 13:25:11 -07:00
|
|
|
containerRegistry: Docker Hub
|
|
|
|
tags: |
|
2020-06-19 14:20:48 -07:00
|
|
|
stable-$(Build.BuildNumber)-$(BuildConfiguration)
|
2020-07-27 18:35:57 -07:00
|
|
|
$(JellyfinVersion)-$(BuildConfiguration)
|
2020-06-19 13:25:11 -07:00
|
|
|
|
|
|
|
- job: CollectArtifacts
|
2020-07-31 12:40:09 -07:00
|
|
|
timeoutInMinutes: 10
|
2020-06-19 13:25:11 -07:00
|
|
|
displayName: 'Collect Artifacts'
|
|
|
|
dependsOn:
|
|
|
|
- BuildPackage
|
|
|
|
- BuildDocker
|
|
|
|
condition: and(succeeded('BuildPackage'), succeeded('BuildDocker'))
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: SSH@0
|
|
|
|
displayName: 'Update Unstable Repository'
|
2020-06-20 12:03:25 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
2020-06-19 13:25:11 -07:00
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
2020-07-31 15:20:47 -07:00
|
|
|
runOptions: 'commands'
|
2020-08-04 13:35:23 -07:00
|
|
|
commands: sudo -n /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable
|
2020-06-19 13:25:11 -07:00
|
|
|
|
|
|
|
- task: SSH@0
|
|
|
|
displayName: 'Update Stable Repository'
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
2020-07-31 15:32:25 -07:00
|
|
|
runOptions: 'commands'
|
2020-08-04 13:35:23 -07:00
|
|
|
commands: sudo -n /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber)
|
|
|
|
|
2020-07-19 10:59:07 -07:00
|
|
|
- job: PublishNuget
|
|
|
|
displayName: 'Publish NuGet packages'
|
|
|
|
dependsOn:
|
|
|
|
- BuildPackage
|
2020-07-19 14:54:46 -07:00
|
|
|
condition: and(succeeded('BuildPackage'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
|
2020-07-31 15:20:47 -07:00
|
|
|
|
2020-07-19 10:59:07 -07:00
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
2020-08-13 06:22:12 -07:00
|
|
|
- task: DotNetCoreCLI@2
|
2020-07-19 10:59:07 -07:00
|
|
|
inputs:
|
|
|
|
command: 'pack'
|
2020-08-13 06:22:12 -07:00
|
|
|
packagesToPack: 'Jellyfin.Data/Jellyfin.Data.csproj;MediaBrowser.Common/MediaBrowser.Common.csproj;MediaBrowser.Controller/MediaBrowser.Controller.csproj;MediaBrowser.Model/MediaBrowser.Model.csproj;Emby.Naming/Emby.Naming.csproj'
|
|
|
|
versioningScheme: 'off'
|
2020-07-19 10:59:07 -07:00
|
|
|
|
2020-08-13 06:35:56 -07:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
inputs:
|
|
|
|
pathToPublish: $(Build.ArtifactStagingDirectory)
|
|
|
|
artifactName: Jellyfin Nuget Packages
|
|
|
|
|
2020-07-19 10:59:07 -07:00
|
|
|
- task: NuGetCommand@2
|
|
|
|
inputs:
|
|
|
|
command: 'push'
|
|
|
|
packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg'
|
|
|
|
includeNugetOrg: 'true'
|