diff --git a/azure-pipelines-production.yml b/azure-pipelines-production.yml new file mode 100644 index 0000000..5c57493 --- /dev/null +++ b/azure-pipelines-production.yml @@ -0,0 +1,56 @@ +trigger: + tags: + include: + - release-* + +jobs: +- job: initialize + displayName: Initialize + pool: + vmImage: ubuntu-latest + steps: + - checkout: self + clean: true + fetchDepth: 1 + - 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 diff --git a/azure-pipelines-staging.yml b/azure-pipelines-staging.yml new file mode 100644 index 0000000..4495b2c --- /dev/null +++ b/azure-pipelines-staging.yml @@ -0,0 +1,59 @@ +trigger: + branches: + include: + - main + tags: + include: + - stage-* + +jobs: +- job: initialize + displayName: Initialize + pool: + vmImage: ubuntu-latest + steps: + - checkout: self + clean: true + fetchDepth: 1 + - 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 \ No newline at end of file