Untitled

mail@pastecode.io avatar
unknown
yaml
2 months ago
4.4 kB
3
Indexable
Never
- stage: DeployToQA
  displayName: Deploy to test (QA)
  jobs:
  - job: DeployAzureAppServices
    displayName: Deploy Azure App Services
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: echo "Deploying API..."
      displayName: 'Echo Deploying API'
    - task: AzureWebApp@1
      displayName: 'Deploy API to Azure Web App'
      inputs:
        azureSubscription: '<Azure-Service-Connection-Name>'
        appName: 'app-confluence-rex-api-qa'
        package: '$(Build.ArtifactStagingDirectory)/artifacts/api.zip'
    - script: echo "Deploying Mock ML API..."
      displayName: 'Echo Deploying Mock ML API'
    - task: AzureWebApp@1
      displayName: 'Deploy Mock ML API to Azure Web App'
      inputs:
        azureSubscription: '<Azure-Service-Connection-Name>'
        appName: 'app-confluence-rex-mock-ml-qa'
        package: '$(Build.ArtifactStagingDirectory)/artifacts/mock-ml-api.zip'

  - job: DeployStaticWebSite
    displayName: Deploy Azure Static Web Site
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - task: NodeTool@0
      inputs:
        versionSpec: '18.x'
      displayName: 'Install Node.js'
    - script: |
        cd src/confluence-rex-web
        npm install
        npx swa deploy confluence-rex-web-qa --deployment-token $(AZURE_SWA_DEPLOYMENT_TOKEN) --env production
      displayName: 'Deploy Static Web App'
      env:
        AZURE_SWA_DEPLOYMENT_TOKEN: $(AZURE_SWA_DEPLOYMENT_TOKEN)

  - job: ApplyDatabaseMigrations
    displayName: Apply Database Migrations
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: |
        ./artifacts/efbundle --connection "$(AZURE_DB_CONNECTION_STRING)"
      displayName: 'Apply Database Migrations'
      env:
        AZURE_DB_CONNECTION_STRING: $(AZURE_DB_CONNECTION_STRING)

  - job: ApplyMockMLDatabaseMigrations
    displayName: Apply Mock ML Database Migrations
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: |
        ./artifacts/mock_efbundle --connection "$(AZURE_DB_CONNECTION_STRING)"
      displayName: 'Apply Mock ML Database Migrations'
      env:
        AZURE_DB_CONNECTION_STRING: $(AZURE_DB_CONNECTION_STRING)


- stage: DeployToStagingDemo
  displayName: Deploy to Staging (Demo)
  jobs:
  - job: DeployAzureAppServices
    displayName: Deploy Azure App Services
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: echo "Deploying API..."
      displayName: 'Echo Deploying API'
    - task: AzureWebApp@1
      displayName: 'Deploy API to Azure Web App'
      inputs:
        azureSubscription: '<Azure-Service-Connection-Name>'
        appName: 'app-confluence-rex-api-demo'
        package: '$(Build.ArtifactStagingDirectory)/artifacts/api.zip'
    - script: echo "Deploying Mock ML API..."
      displayName: 'Echo Deploying Mock ML API'
    - task: AzureWebApp@1
      displayName: 'Deploy Mock ML API to Azure Web App'
      inputs:
        azureSubscription: '<Azure-Service-Connection-Name>'
        appName: 'app-confluence-rex-mock-ml-demo'
        package: '$(Build.ArtifactStagingDirectory)/artifacts/mock-ml-api.zip'

  - job: DeployStaticWebSite
    displayName: Deploy Azure Static Web Site
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - task: NodeTool@0
      inputs:
        versionSpec: '18.x'
      displayName: 'Install Node.js'
    - script: |
        cd src/confluence-rex-web
        npm install
        npx swa build confluence-rex-web-demo
        npx swa deploy confluence-rex-web-demo --deployment-token $(AZURE_SWA_DEPLOYMENT_TOKEN) --env production
      displayName: 'Deploy Static Web App'
      env:
        AZURE_SWA_DEPLOYMENT_TOKEN: $(AZURE_SWA_DEPLOYMENT_TOKEN)

  - job: ApplyDatabaseMigrations
    displayName: Apply Database Migrations
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: |
        ./artifacts/efbundle --connection "$(AZURE_DB_CONNECTION_STRING)"
      displayName: 'Apply Database Migrations'
      env:
        AZURE_DB_CONNECTION_STRING: $(AZURE_DB_CONNECTION_STRING)

  - job: ApplyMockMLDatabaseMigrations
    displayName: Apply Mock ML Database Migrations
    pool:
      vmImage: 'ubuntu-latest'
    steps:
    - script: |
        ./artifacts/mock_efbundle --connection "$(AZURE_DB_CONNECTION_STRING)"
      displayName: 'Apply Mock ML Database Migrations'
      env:
        AZURE_DB_CONNECTION_STRING: $(AZURE_DB_CONNECTION_STRING)
Leave a Comment