Advertisement
Guest User

ModernApiAppRepository_azure-pipelines.yml

a guest
Dec 12th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. # Docker
  2. # Build a Docker image
  3. # https://docs.microsoft.com/azure/devops/pipelines/languages/docker
  4. name: $(Date:yyyyMMdd)$(Rev:.r)
  5.  
  6. trigger:
  7. - master
  8.  
  9. resources:
  10. - repo: self
  11.  
  12. variables:
  13. # Container registry service connection established during pipeline creation
  14. dockerRegistryServiceConnection: 'ACR'
  15. imageRepository: 'modernapi'
  16. containerRegistry: 'holdevtestacriqp.azurecr.io'
  17. dockerfilePath: '$(Build.SourcesDirectory)/apiapp.Dockerfile'
  18. tag: '$(Build.BuildNumber)'
  19. imageName: $(Build.DefinitionName):$(Build.BuildNumber)
  20. # Agent VM image name
  21. vmImageName: 'ubuntu-latest'
  22.  
  23. stages:
  24. - stage: Build
  25. displayName: Build and push the modernapi container and copy sql files
  26. jobs:
  27. - job: Build
  28. displayName: Build
  29. pool:
  30. vmImage: $(vmImageName)
  31. steps:
  32. - task: Docker@2
  33. displayName: Build and push the api image to container registry
  34. inputs:
  35. command: buildAndPush
  36. repository: $(imageRepository)
  37. dockerfile: $(dockerfilePath)
  38. containerRegistry: $(dockerRegistryServiceConnection)
  39. tags: |
  40. $(tag)
  41. latest
  42. - task: CopyFiles@2
  43. displayName: Copy the sql deployment files
  44. inputs:
  45. SourceFolder: 'ModernApiApp.Database/deploy'
  46. Contents: '*.sql'
  47. TargetFolder: '$(build.artifactstagingdirectory)'
  48. flattenFolders: true
  49. - task: PublishBuildArtifacts@1
  50. displayName: Publish the sql deployment scripts to the artifacts drop
  51. inputs:
  52. PathtoPublish: '$(Build.ArtifactStagingDirectory)'
  53. ArtifactName: 'drop'
  54. publishLocation: 'Container'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement