# Variable 'static_dictation_deployment_token' was defined in the Variables tab trigger: branches: include: - refs/heads/develop jobs: - job: Job_1 displayName: Dictation App Service Deploy pool: name: odms-deploy-pipeline steps: - checkout: self clean: true fetchDepth: 1 - task: Npm@1 displayName: npm ci inputs: command: ci workingDir: dictation_server verbose: false - task: AzureKeyVault@2 displayName: 'Azure Key Vault: kv-odms-secret-dev' inputs: ConnectedServiceName: 82047c72-0cfe-43b0-bb2f-cdfd8b165e68 KeyVaultName: kv-odms-secret-dev SecretsFilter: token-public-key - task: Bash@3 displayName: Bash Script (Test) inputs: targetType: inline filePath: cd dictation_server && JWT_PUBLIC_KEY="$JWT_PUBLIC_KEY" && npm run test script: > cd dictation_server && JWT_PUBLIC_KEY="$JWT_PUBLIC_KEY" && npm run test - task: Docker@0 displayName: build inputs: azureSubscriptionEndpoint: 827be338-1846-4102-b006-f457c92883d3 azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}' dockerFile: DockerfileServerDictation.dockerfile imageName: $(Build.Repository.Name)/dictation:latest - task: Docker@0 displayName: Push inputs: azureSubscriptionEndpoint: 827be338-1846-4102-b006-f457c92883d3 azureContainerRegistry: '{"loginServer":"crodmsregistrymaintenance.azurecr.io", "id" : "/subscriptions/108fb131-cdca-4729-a2be-e5bd8c0b3ba7/resourceGroups/maintenance-rg/providers/Microsoft.ContainerRegistry/registries/crOdmsRegistryMaintenance"}' action: Push an image imageName: $(Build.Repository.Name)/dictation:latest - job: Job_2 displayName: Dictation Static App Service Deploy pool: vmImage: ubuntu-latest steps: - checkout: self clean: true fetchDepth: 1 - task: Npm@1 displayName: npm ci inputs: command: ci workingDir: dictation_client verbose: false - task: Bash@3 displayName: Bash Script inputs: targetType: inline script: cd dictation_client && npm run build - task: AzureStaticWebApp@0 displayName: 'Static Web App: ' inputs: app_location: /dictation_client/build config_file_location: /dictation_client skip_app_build: true skip_api_build: true is_static_export: false verbose: false azure_static_web_apps_api_token: $(static_dictation_deployment_token) - job: Job_3 displayName: DB migration dependsOn: - Job_1 - Job_2 pool: name: odms-deploy-pipeline steps: - checkout: self clean: true fetchDepth: 1 - task: AzureKeyVault@2 displayName: 'Azure Key Vault: kv-odms-secret-dev' inputs: ConnectedServiceName: 82047c72-0cfe-43b0-bb2f-cdfd8b165e68 KeyVaultName: kv-odms-secret-dev - task: CmdLine@2 displayName: migration inputs: script: >2 # DB接続情報書き換え sed -i -e "s/DB_NAME/$(db-name)/g" ./dictation_server/db/dbconfig.yml sed -i -e "s/DB_PASS/$(db-pass)/g" ./dictation_server/db/dbconfig.yml sed -i -e "s/DB_USERNAME/$(db-user)/g" ./dictation_server/db/dbconfig.yml sed -i -e "s/DB_PORT/$(db-port)/g" ./dictation_server/db/dbconfig.yml sed -i -e "s/DB_HOST/$(db-host)/g" ./dictation_server/db/dbconfig.yml sql-migrate --version cat ./dictation_server/db/dbconfig.yml # migration実行 sql-migrate up -config=./dictation_server/db/dbconfig.yml -env=ci - job: Job_4 displayName: Docker Image Clean Up dependsOn: Job_1 pool: name: odms-deploy-pipeline steps: - checkout: self clean: true fetchDepth: 1 - task: Docker@0 displayName: Clean up inputs: action: Run a Docker command imageName: $(Build.Repository.Name)/dictation:latest customCommand: 'image prune -af ' ...