diff --git a/azure-pipelines.eventhub.httpapi.host.yml b/azure-pipelines.eventhub.httpapi.host.yml new file mode 100644 index 0000000..2b42dd8 --- /dev/null +++ b/azure-pipelines.eventhub.httpapi.host.yml @@ -0,0 +1,69 @@ +# Deploy to Azure Kubernetes Service +# Build and push image to Azure Container Registry; Deploy to Azure Kubernetes Service +# https://docs.microsoft.com/azure/devops/pipelines/languages/docker + +trigger: +- dev + + +variables: + + # Container registry service connection established during pipeline creation + dockerRegistryServiceConnection: '6e711767-783e-49d4-a0c2-16456b30f2c3' + imageRepository: 'voloeventhubhttpapihost' + containerRegistry: 'voloeventhubhttpapihost.azurecr.io' + dockerfilePath: '**/Dockerfile.EventHub.HttpApi.Host' + tag: '$(Build.BuildNumber)' + + # Agent VM image name + vmImageName: 'ubuntu-latest' + + +stages: +- stage: Build + displayName: Build stage + jobs: + - job: Build + displayName: Build + pool: + vmImage: $(vmImageName) + steps: + - task: Docker@2 + displayName: Build and push an image to container registry + inputs: + command: buildAndPush + repository: $(imageRepository) + dockerfile: $(dockerfilePath) + containerRegistry: $(dockerRegistryServiceConnection) + tags: | + $(tag) + + - publish: manifests + artifact: manifests + +- stage: Deploy + displayName: Deploy stage + dependsOn: Build + + jobs: + - deployment: Deploy + displayName: Deploy-HttpApi.Host + pool: + vmImage: $(vmImageName) + environment: 'volosofteventhub-1094.default' + strategy: + runOnce: + deploy: + steps: + + + - task: KubernetesManifest@0 + displayName: Deploy to Kubernetes cluster + inputs: + action: deploy + manifests: | + $(Pipeline.Workspace)/manifests/deployment.eventhub.web.yml + $(Pipeline.Workspace)/manifests/service.eventhub.web.yml + containers: | + $(containerRegistry)/$(imageRepository):$(tag) +