2019-09-19 11:35:30 -07:00
|
|
|
trigger:
|
|
|
|
batch: true
|
|
|
|
branches:
|
|
|
|
include:
|
2020-04-03 08:09:47 -07:00
|
|
|
- '*'
|
2019-09-19 11:35:30 -07:00
|
|
|
tags:
|
|
|
|
include:
|
|
|
|
- '*'
|
2020-03-15 13:53:28 -07:00
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
|
|
|
- '*'
|
2019-09-19 11:35:30 -07:00
|
|
|
|
|
|
|
jobs:
|
2020-04-12 09:02:19 -07:00
|
|
|
- job: Build
|
|
|
|
displayName: 'Build'
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
Development:
|
|
|
|
BuildConfiguration: development
|
|
|
|
Production:
|
|
|
|
BuildConfiguration: production
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: 'Install Node'
|
|
|
|
inputs:
|
|
|
|
versionSpec: '12.x'
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
displayName: 'Check Cache'
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | yarn.lock'
|
|
|
|
path: 'node_modules'
|
|
|
|
cacheHitVar: CACHE_RESTORED
|
|
|
|
|
|
|
|
- script: 'yarn install --frozen-lockfile'
|
|
|
|
displayName: 'Install Dependencies'
|
|
|
|
condition: ne(variables.CACHE_RESTORED, 'true')
|
|
|
|
|
|
|
|
- script: 'yarn build:development'
|
|
|
|
displayName: 'Build Development'
|
|
|
|
condition: eq(variables['BuildConfiguration'], 'development')
|
|
|
|
|
|
|
|
- script: 'yarn build:production'
|
2020-05-30 21:55:47 -07:00
|
|
|
displayName: 'Build Production'
|
2020-04-12 09:02:19 -07:00
|
|
|
condition: eq(variables['BuildConfiguration'], 'production')
|
|
|
|
|
|
|
|
- script: 'test -d dist'
|
|
|
|
displayName: 'Check Build'
|
|
|
|
|
|
|
|
- script: 'mv dist jellyfin-web'
|
|
|
|
displayName: 'Rename Directory'
|
|
|
|
|
|
|
|
- task: ArchiveFiles@2
|
|
|
|
displayName: 'Archive Directory'
|
|
|
|
inputs:
|
|
|
|
rootFolderOrFile: 'jellyfin-web'
|
|
|
|
includeRootFolder: true
|
|
|
|
archiveFile: 'jellyfin-web-$(BuildConfiguration)'
|
|
|
|
|
|
|
|
- task: PublishPipelineArtifact@1
|
|
|
|
displayName: 'Publish Release'
|
|
|
|
inputs:
|
|
|
|
targetPath: '$(Build.SourcesDirectory)/jellyfin-web-$(BuildConfiguration).zip'
|
|
|
|
artifactName: 'jellyfin-web-$(BuildConfiguration)'
|
|
|
|
|
|
|
|
- job: Lint
|
|
|
|
displayName: 'Lint'
|
|
|
|
|
|
|
|
pool:
|
|
|
|
vmImage: 'ubuntu-latest'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: NodeTool@0
|
|
|
|
displayName: 'Install Node'
|
|
|
|
inputs:
|
|
|
|
versionSpec: '12.x'
|
|
|
|
|
|
|
|
- task: Cache@2
|
|
|
|
displayName: 'Check Cache'
|
|
|
|
inputs:
|
|
|
|
key: 'yarn | yarn.lock'
|
|
|
|
path: 'node_modules'
|
|
|
|
cacheHitVar: CACHE_RESTORED
|
|
|
|
|
|
|
|
- script: 'yarn install --frozen-lockfile'
|
|
|
|
displayName: 'Install Dependencies'
|
|
|
|
condition: ne(variables.CACHE_RESTORED, 'true')
|
|
|
|
|
|
|
|
- script: 'yarn run lint --quiet'
|
|
|
|
displayName: 'Run ESLint'
|
|
|
|
|
|
|
|
- script: 'yarn run stylelint'
|
|
|
|
displayName: 'Run Stylelint'
|