2020-06-12 08:18:20 -07:00
|
|
|
jobs:
|
2020-06-14 16:23:27 -07:00
|
|
|
- job: BuildPackage
|
|
|
|
displayName: 'Build Packages'
|
2020-06-12 08:18:20 -07:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
CentOS:
|
|
|
|
BuildConfiguration: centos
|
|
|
|
Debian:
|
|
|
|
BuildConfiguration: debian
|
|
|
|
Fedora:
|
|
|
|
BuildConfiguration: fedora
|
|
|
|
Portable:
|
|
|
|
BuildConfiguration: portable
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- script: 'docker build -f deployment/Dockerfile.$(BuildConfiguration) -t jellyfin-web-$(BuildConfiguration) deployment'
|
|
|
|
displayName: 'Build Dockerfile'
|
2020-06-14 10:39:00 -07:00
|
|
|
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
|
2020-06-12 08:18:20 -07:00
|
|
|
|
2020-06-12 14:20:01 -07:00
|
|
|
- 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-web-$(BuildConfiguration)'
|
|
|
|
displayName: 'Run Dockerfile (unstable)'
|
2020-06-12 15:18:11 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
2020-06-12 14:20:01 -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-web-$(BuildConfiguration)'
|
|
|
|
displayName: 'Run Dockerfile (stable)'
|
2020-06-12 15:18:11 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
2020-06-12 08:18:20 -07:00
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 'Publish Release'
|
2020-06-14 10:39:00 -07:00
|
|
|
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
|
2020-06-12 08:18:20 -07:00
|
|
|
inputs:
|
|
|
|
targetPath: '$(Build.SourcesDirectory)/deployment/dist'
|
|
|
|
artifactName: 'jellyfin-web-$(BuildConfiguration)'
|
2020-06-12 12:09:23 -07:00
|
|
|
|
2020-07-13 11:32:56 -07:00
|
|
|
- task: SSH@0
|
|
|
|
displayName: 'Create target directory on repository server'
|
|
|
|
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
|
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
runOptions: 'inline'
|
|
|
|
inline: 'mkdir -p /srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
|
|
|
|
|
2020-06-12 12:09:23 -07:00
|
|
|
- task: CopyFilesOverSSH@0
|
|
|
|
displayName: 'Upload artifacts to repository server'
|
2020-06-14 10:39:00 -07:00
|
|
|
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
|
2020-06-12 12:09:23 -07:00
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
|
|
|
|
contents: '**'
|
2020-06-12 14:20:01 -07:00
|
|
|
targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
|
2020-06-12 13:56:45 -07:00
|
|
|
|
2020-06-14 16:23:27 -07:00
|
|
|
- job: BuildDocker
|
|
|
|
displayName: 'Build Docker'
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
2020-07-27 18:41:57 -07:00
|
|
|
variables:
|
|
|
|
- name: JellyfinVersion
|
|
|
|
value: 0.0.0
|
|
|
|
|
2020-06-14 16:23:27 -07:00
|
|
|
steps:
|
2020-07-27 18:41:57 -07:00
|
|
|
- script: echo '##vso[task.setvariable variable=JellyfinVersion]$( awk -F "/" "{ print $NF }" <<<"$(Build.SourceBranch)" | sed "s/^v//" )'
|
|
|
|
displayName: Set release version (stable)
|
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
|
|
|
|
2020-06-14 16:59:32 -07:00
|
|
|
- task: Docker@2
|
2020-06-15 03:49:17 -07:00
|
|
|
displayName: 'Push Unstable Image'
|
2020-06-14 16:59:32 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
|
|
|
inputs:
|
2020-06-15 03:49:17 -07:00
|
|
|
repository: 'jellyfin/jellyfin-web'
|
2020-06-14 16:59:32 -07:00
|
|
|
command: buildAndPush
|
|
|
|
buildContext: '.'
|
2020-06-15 03:49:17 -07:00
|
|
|
Dockerfile: 'deployment/Dockerfile.docker'
|
2020-06-14 16:59:32 -07:00
|
|
|
containerRegistry: Docker Hub
|
|
|
|
tags: |
|
|
|
|
unstable-$(Build.BuildNumber)
|
|
|
|
unstable
|
|
|
|
|
|
|
|
- task: Docker@2
|
2020-06-15 03:49:17 -07:00
|
|
|
displayName: 'Push Stable Image'
|
2020-06-14 16:23:27 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
2020-06-14 16:59:32 -07:00
|
|
|
inputs:
|
2020-06-15 03:49:17 -07:00
|
|
|
repository: 'jellyfin/jellyfin-web'
|
2020-06-14 16:59:32 -07:00
|
|
|
command: buildAndPush
|
|
|
|
buildContext: '.'
|
2020-06-15 03:49:17 -07:00
|
|
|
Dockerfile: 'deployment/Dockerfile.docker'
|
2020-06-14 16:59:32 -07:00
|
|
|
containerRegistry: Docker Hub
|
|
|
|
tags: |
|
|
|
|
stable-$(Build.BuildNumber)
|
2020-07-27 18:41:57 -07:00
|
|
|
$(JellyfinVersion)
|
2020-06-14 16:23:27 -07:00
|
|
|
|
2020-06-15 03:49:17 -07:00
|
|
|
- job: CollectArtifacts
|
2020-06-12 14:31:24 -07:00
|
|
|
displayName: 'Collect Artifacts'
|
2020-06-15 22:12:46 -07:00
|
|
|
dependsOn:
|
|
|
|
- BuildPackage
|
|
|
|
- BuildDocker
|
2020-06-15 22:14:48 -07:00
|
|
|
condition: and(succeeded('BuildPackage'), succeeded('BuildDocker'))
|
2020-06-12 14:31:24 -07:00
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
2020-06-12 13:56:45 -07:00
|
|
|
- task: SSH@0
|
2020-06-15 03:49:17 -07:00
|
|
|
displayName: 'Update Unstable Repository'
|
2020-06-12 15:18:11 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
|
2020-06-12 13:56:45 -07:00
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
runOptions: 'inline'
|
2020-06-12 15:16:02 -07:00
|
|
|
inline: 'sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable'
|
2020-06-12 14:20:01 -07:00
|
|
|
|
|
|
|
- task: SSH@0
|
2020-06-15 03:49:17 -07:00
|
|
|
displayName: 'Update Stable Repository'
|
2020-06-12 15:18:11 -07:00
|
|
|
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
|
2020-06-12 14:20:01 -07:00
|
|
|
inputs:
|
|
|
|
sshEndpoint: repository
|
|
|
|
runOptions: 'inline'
|
2020-06-12 15:16:02 -07:00
|
|
|
inline: 'sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber)'
|