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

109 lines
4.7 KiB
YAML
Raw Normal View History

jobs:
2020-06-14 19:23:27 -04: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 15:09:23 -04: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 15:09:23 -04:00
inputs:
sshEndpoint: repository
sourceFolder: '$(Build.SourcesDirectory)/deployment/dist'
contents: '**'
targetFolder: '/srv/repository/incoming/azure/$(Build.BuildNumber)/$(BuildConfiguration)'
2020-06-12 16:56:45 -04:00
2020-06-14 19:23:27 -04:00
- job: BuildDocker
displayName: 'Build Docker'
pool:
vmImage: 'ubuntu-latest'
steps:
- script: 'docker build -f deployment/Dockerfile.docker -t "jellyfin-web":"unstable-$(Build.BuildNumber)" .'
2020-06-14 19:23:27 -04:00
displayName: 'Build Dockerfile (unstable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package')
- script: 'docker push "jellyfin-web":"unstable-$(Build.BuildNumber)"'
2020-06-14 19:23:27 -04:00
displayName: 'Push Docker image (unstable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package')
- script: 'docker manifest create --amend "jellyfin-web":"unstable" "jellyfin-web":"unstable-$(Build.BuildNumber)"'
2020-06-14 19:23:27 -04:00
displayName: 'Create Docker manifest (unstable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package')
- script: 'docker manifest push --purge "jellyfin-web":"unstable"'
displayName: 'Push Docker manifest (unstable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/package')
2020-06-14 19:23:27 -04:00
- script: 'docker build -f deployment/Dockerfile.docker -t "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )" .'
displayName: 'Build Dockerfile (stable)'
2020-06-14 19:23:27 -04:00
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- script: 'docker push "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )"'
displayName: 'Push Docker image (stable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
2020-06-14 19:23:27 -04:00
- script: 'docker manifest create --amend "jellyfin-web":"stable" "jellyfin-web":"stable-$( sed "s|^refs/tags/v||g" <<<"$(Build.SourceBranch)" )"'
displayName: 'Create Docker manifest (stable)'
2020-06-14 19:23:27 -04:00
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- script: 'docker manifest push --purge "jellyfin-web-stable":"stable"'
2020-06-14 19:23:27 -04:00
displayName: 'Push Docker manifest (stable, latest)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
- job: Collect
displayName: 'Collect Artifacts'
pool:
vmImage: 'ubuntu-latest'
steps:
2020-06-12 16:56:45 -04:00
- task: SSH@0
displayName: 'Collect packages into repositories (unstable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/heads/master')
2020-06-12 16:56:45 -04:00
inputs:
sshEndpoint: repository
runOptions: 'inline'
2020-06-12 18:16:02 -04:00
inline: 'sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber) unstable'
- task: SSH@0
displayName: 'Collect packages into repositories (stable)'
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags')
inputs:
sshEndpoint: repository
runOptions: 'inline'
2020-06-12 18:16:02 -04:00
inline: 'sudo /srv/repository/collect-server.azure.sh /srv/repository/incoming/azure $(Build.BuildNumber)'