From 0647bd8d069af9458caf29e1829e3812286fc20f Mon Sep 17 00:00:00 2001 From: yusufkaratoprak Date: Sun, 9 May 2021 17:01:20 +0300 Subject: [PATCH] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 61 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..336cec6 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,61 @@ +trigger: +- dev + +variables: + dockerRegistryServiceConnection: 'efbb038e-4f76-4833-a538-fbd8ecb7c545' + imageRepository: 'eventhubhttpapihost' + containerRegistry: 'eventhubregistry.azurecr.io' + dockerfilePath: '**/Dockerfile.EventHub.HttpApi.Host' + tag: '$(Build.BuildNumber)' + + # Agent VM image namedocker images + 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) + + - upload: manifests + artifact: manifests + +- stage: Deploy + displayName: Deploy stage + dependsOn: Build + + jobs: + - deployment: Deploy + displayName: Deploy-HttpApi-Host + pool: + vmImage: $(vmImageName) + environment: 'volosofteventhub-6504.default' + strategy: + runOnce: + deploy: + steps: + + - task: KubernetesManifest@0 + displayName: Deploy to Kubernetes cluster + inputs: + action: deploy + manifests: | + $(Pipeline.Workspace)/manifests/deployment.eventhub.httpapi.host.yml + $(Pipeline.Workspace)/manifests/service.eventhub.httpapi.host.yml + containers: | + $(containerRegistry)/$(imageRepository):$(tag) +