jellyfin-web/.ci/azure-pipelines-package.yml

115 lines
4.1 KiB
YAML
Raw Normal View History

jobs:
2020-06-14 16:23:27 -07:00
- job: BuildPackage
displayName: 'Build Packages'
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'
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
- 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)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
- 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)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- task: PublishPipelineArtifact@1
displayName: 'Publish Release'
condition: or(startsWith(variables['Build.SourceBranch'], 'refs/tags'), startsWith(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
targetPath: '$(Build.SourcesDirectory)/deployment/dist'
artifactName: 'jellyfin-web-$(BuildConfiguration)'
2020-06-12 12:09:23 -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'
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: '**'
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'
steps:
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)
stable
2020-06-14 16:23:27 -07:00
2020-06-15 03:49:17 -07:00
- job: CollectArtifacts
displayName: 'Collect Artifacts'
dependsOn:
- BuildPackage
- BuildDocker
condition: and(succeeded('BuildPackage'), succeeded('BuildDocker'))
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'
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'
- task: SSH@0
2020-06-15 03:49:17 -07:00
displayName: 'Update Stable Repository'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
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)'