OMDSCloud/azure-pipelines-staging.yml
湯本 開 c42ba4d3db Merged PR 353: staging用pipelineのymlのトリガーを修正する
## 概要
[Task2488: staging用pipelineのymlのトリガーを修正する](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/2488)

- (まだ稼働していないStagingデプロイパイプラインの)トリガー部分のチェックロジックが権限不足で動作していなかった箇所を修正

## レビューポイント
- 情報共有

## 動作確認状況
- mainブランチ外のブランチがpipeline上で実行された時に失敗することを確認
2023-08-24 03:23:51 +00:00

60 lines
1.3 KiB
YAML

trigger:
branches:
include:
- main
tags:
include:
- stage-*
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: backend_build
dependsOn: initialize
condition: succeeded('initialize')
displayName: Dictation App Service Deploy
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
clean: true
fetchDepth: 1
- job: frontend_build
dependsOn: initialize
condition: succeeded('initialize')
displayName: Dictation Static App Service Deploy
pool:
vmImage: ubuntu-latest
steps:
- checkout: self
clean: true
fetchDepth: 1
- job: migration
condition: succeeded('initialize')
displayName: DB migration
dependsOn:
- initialize
- backend_build
- frontend_build
pool:
name: db-migrate-pipelines
steps:
- checkout: self
clean: true
fetchDepth: 1