Browse Source

update for azure pipeline

pull/37/head
yusuf karatoprak 6 years ago
parent
commit
37fa527dc9
  1. 65
      azure-pipelines.yml

65
azure-pipelines.yml

@ -0,0 +1,65 @@
# 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: '0648130a-0d3e-41f3-b92e-fc7f620264e8'
imageRepository: 'voloeventhub'
containerRegistry: 'voloeventhub.azurecr.io'
dockerfilePath: '**/Dockerfile'
tag: '$(Build.BuildName)'
# 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
pool:
vmImage: $(vmImageName)
environment: 'volosofteventhub.default'
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
manifests: |
$(Pipeline.Workspace)/manifests/deployment.yml
$(Pipeline.Workspace)/manifests/service.yml
containers: |
$(containerRegistry)/$(imageRepository):$(tag)
Loading…
Cancel
Save