Browse Source

Merge branch 'main' of https://github.com/volosoft/eventhub into main

staging
yusuf karatoprak 6 years ago
parent
commit
c91a2ee6b9
  1. 72
      azure-pipelines-1.yml
  2. 71
      azure-pipelines.yml
  3. 19
      manifests/deployment.yml
  4. 10
      manifests/service.yml

72
azure-pipelines-1.yml

@ -0,0 +1,72 @@
# 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)

71
azure-pipelines.yml

@ -0,0 +1,71 @@
# 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)

19
manifests/deployment.yml

@ -0,0 +1,19 @@
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

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