Browse Source

update azure pipeline 2

staging
yusuf karatoprak 5 years ago
parent
commit
3cec6d5fc8
  1. 72
      azure-pipelines-1.yml
  2. 2
      azure-pipelines.eventhub.httpapi.host.yml
  3. 2
      azure-pipelines.eventhub.web.yml
  4. 71
      azure-pipelines.yml
  5. 2
      manifests/deployment.eventhub.httpapi.host.yml
  6. 2
      manifests/deployment.eventhub.identityserver.yml
  7. 2
      manifests/deployment.eventhub.web.yml
  8. 19
      manifests/deployment.yml
  9. 10
      manifests/service.yml

72
azure-pipelines-1.yml

@ -1,72 +0,0 @@
# 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:
- main
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'be4690ca-0fbe-4473-a10e-c45c2a32a3c1'
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
timeoutInMinutes: 60 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 30 # how much time to give 'run always even if cancelled tasks' before stopping them
pool:
vmImage: $(vmImageName)
environment: 'voloeventhubhttpapihost.default'
strategy:
runOnce:
deploy:
steps:
- task: KubernetesManifest@0
displayName: Deploy to Kubernetes cluster
inputs:
action: deploy
namespace: default
manifests: |
$(Pipeline.Workspace)/manifests/deployment.eventhub.httpapi.host.yml
$(Pipeline.Workspace)/manifests/service.eventhub.httpapi.host.yml
containers: |
$(containerRegistry)/$(imageRepository):$(tag)

2
azure-pipelines.eventhub.httpapi.host.yml

@ -10,7 +10,7 @@ variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'be4690ca-0fbe-4473-a10e-c45c2a32a3c1'
imageRepository: 'voloeventhubhttpapihost'
imageRepository: 'voloeventhubhttpapihost'
containerRegistry: 'voloeventhubhttpapihost.azurecr.io'
dockerfilePath: '**/Dockerfile.EventHub.HttpApi.Host'
tag: '$(Build.BuildNumber)'

2
azure-pipelines.eventhub.web.yml

@ -10,7 +10,7 @@ variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '1ae4ab3c-b39a-4860-b6dc-683cc524d1e4'
imageRepository: 'volosofteventhub'
imageRepository: 'voloeventhub'
containerRegistry: 'voloeventhub.azurecr.io'
dockerfilePath: '**/Dockerfile.EventHub.Web'
tag: '$(Build.BuildNumber)'

71
azure-pipelines.yml

@ -1,71 +0,0 @@
# 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:
- main
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: '1ae4ab3c-b39a-4860-b6dc-683cc524d1e4'
imageRepository: 'volosofteventhub'
containerRegistry: 'voloeventhub.azurecr.io'
dockerfilePath: '**/Dockerfile.EventHub.Web'
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-EventHub.Web
timeoutInMinutes: 60 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 30 # how much time to give 'run always even if cancelled tasks' before stopping them
pool:
vmImage: $(vmImageName)
environment: 'voloeventhub.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)

2
manifests/deployment.eventhub.httpapi.host.yml

@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: volosoft-eventhub-httpapi-host-container
image: voloeventhubhttpapihost.azurecr.io/voloeventhubhttpapihost:v1
image: voloeventhubhttpapihost.azurecr.io/voloeventhubhttpapihost
imagePullPolicy: Always
resources:
limits:

2
manifests/deployment.eventhub.identityserver.yml

@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: volosoft-eventhub-identityserver-container
image: voloeventhubidentityserver.azurecr.io/voloeventhubidentityserver:v1
image: voloeventhubidentityserver.azurecr.io/voloeventhubidentityserver
imagePullPolicy: Always
resources:
limits:

2
manifests/deployment.eventhub.web.yml

@ -13,7 +13,7 @@ spec:
spec:
containers:
- name: volosoft-eventhub-web-container
image: voloeventhub.azurecr.io/voloeventhub:v1
image: voloeventhub.azurecr.io/voloeventhub
imagePullPolicy: Always
resources:
limits:

19
manifests/deployment.yml

@ -1,19 +0,0 @@
apiVersion : apps/v1
kind: Deployment
metadata:
name: volosofteventhub
spec:
replicas: 1
selector:
matchLabels:
app: volosofteventhub
template:
metadata:
labels:
app: volosofteventhub
spec:
containers:
- name: volosofteventhub
image: voloeventhub.azurecr.io/volosofteventhub
ports:
- containerPort: 8080

10
manifests/service.yml

@ -1,10 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: volosofteventhub
spec:
type: LoadBalancer
ports:
- port: 8080
selector:
app: volosofteventhub
Loading…
Cancel
Save