diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba12fd40c..b75afdd9f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -13,8 +13,8 @@ pool: name: $(Build.DefinitionName).$(SourceBranchName).$(Date:yyyyMMdd)$(Rev:.r) jobs: - - job: BuildTest - displayName: Build and Test Maven Project + - job: BuildTestDeploy + displayName: Build Test and Deploy spring-petclinic Java Web App steps: - task: Maven@3 displayName: 'Maven Package' @@ -46,3 +46,14 @@ jobs: publishLocation: 'Container' # Publishes inside Azure Pipelines artifact folder. parallel: true # Increased speed through multi-threaded copying. parallelCount: 8 # Dependent upon CPU capabilities. + + - task: AzureWebApp@1 + displayName: Deploy spring-petclinic to Azure Web App service + inputs: + azureSubscription: 'azure-svc-connection' + appType: webAppLinux + appName: 'james-pet-clinic' + package: '$(System.DefaultWorkingDirectory)/**/*.jar' + # Only deploy web app from main branch (for release purposes) + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) + \ No newline at end of file