82 lines
2.5 KiB
YAML
82 lines
2.5 KiB
YAML
# Pipeline側でKeyVaultやDocker、AppService等に対する操作権限を持ったServiceConenctionを作成しておくこと
|
|
# また、環境変数 STATIC_DICTATION_DEPLOYMENT_TOKEN の値として静的WebAppsのデプロイトークンを設定しておくこと
|
|
trigger:
|
|
tags:
|
|
include:
|
|
- pre-release-*
|
|
|
|
# Job 1 : Initialize
|
|
jobs:
|
|
- job: initialize
|
|
displayName: Initialize
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
persistCredentials: true
|
|
- script: |
|
|
git fetch origin main:main
|
|
if git merge-base --is-ancestor $(Build.SourceVersion) main; then
|
|
echo "This commit is in the main branch."
|
|
else
|
|
echo "This commit is not in the main branch."
|
|
exit 1
|
|
fi
|
|
displayName: 'タグが付けられたCommitがmainブランチに存在するか確認'
|
|
|
|
# Job 2 : Convert Audio File Service Deploy
|
|
- job: convert_audio_file_service_deploy
|
|
dependsOn: initialize
|
|
condition: succeeded('initialize')
|
|
displayName: Convert Audio File Service Deploy
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
- task: AzureWebAppContainer@1
|
|
inputs:
|
|
azureSubscription: 'omds-service-connection-prod'
|
|
appName: 'app-odms-convert-audio-prod'
|
|
deployToSlotOrASE: true
|
|
resourceGroupName: 'odms-prod-rg'
|
|
slotName: 'staging'
|
|
containers: 'crodmsregistrymaintenance.azurecr.io/odmscloud/staging/auto_transcription:$(Build.SourceVersion)'
|
|
|
|
# Job 3 : Smoke Test
|
|
- job: smoke_test
|
|
dependsOn: convert_audio_file_service_deploy
|
|
condition: succeeded('convert_audio_file_service_deploy')
|
|
displayName: 'smoke test'
|
|
pool:
|
|
name: odms-deploy-pipeline
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
# スモークテスト用にjobを確保
|
|
|
|
# Job 4 : Convert Audio File Service Slot Swap
|
|
- job: convert_audio_file_swap_slot
|
|
dependsOn: smoke_test
|
|
condition: succeeded('smoke_test')
|
|
displayName: 'Swap Convert Audio File Service Staging and Production'
|
|
pool:
|
|
name: odms-deploy-pipeline
|
|
steps:
|
|
- checkout: self
|
|
clean: true
|
|
fetchDepth: 1
|
|
- task: AzureAppServiceManage@0
|
|
displayName: 'Azure App Service Manage: app-odms-convert-audio-prod'
|
|
inputs:
|
|
azureSubscription: 'omds-service-connection-prod'
|
|
action: 'Swap Slots'
|
|
WebAppName: 'app-odms-convert-audio-prod'
|
|
ResourceGroupName: 'odms-prod-rg'
|
|
SourceSlot: 'staging'
|
|
SwapWithProduction: true
|