mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
66 lines
1.8 KiB
YAML
66 lines
1.8 KiB
YAML
name: $(Rev:r)
|
|
|
|
trigger:
|
|
batch: 'true'
|
|
branches:
|
|
include:
|
|
- master
|
|
paths:
|
|
include:
|
|
- Hub/Service
|
|
|
|
stages:
|
|
- stage: Build
|
|
jobs:
|
|
- job: Build
|
|
pool:
|
|
name: Hosted Ubuntu 1604
|
|
steps:
|
|
- task: Docker@0
|
|
displayName: 'Build an image'
|
|
inputs:
|
|
containerregistrytype: 'Container Registry'
|
|
dockerRegistryConnection: 'Docker Hub'
|
|
dockerFile: 'Hub/Service/Dockerfile'
|
|
imageName: 'ckaczor/home-monitor-hub-service:$(Build.BuildNumber)'
|
|
includeLatestTag: true
|
|
- task: Docker@0
|
|
displayName: 'Push an image'
|
|
inputs:
|
|
containerregistrytype: 'Container Registry'
|
|
dockerRegistryConnection: 'Docker Hub'
|
|
action: 'Push an image'
|
|
imageName: 'ckaczor/home-monitor-hub-service:$(Build.BuildNumber)'
|
|
includeLatestTag: true
|
|
- task: Bash@3
|
|
inputs:
|
|
targetType: 'inline'
|
|
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Hub/Service/deploy/manifest.yaml'
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: 'Hub/Service/deploy/manifest.yaml'
|
|
ArtifactName: 'Manifest'
|
|
publishLocation: 'Container'
|
|
|
|
- stage: Deploy
|
|
jobs:
|
|
- job: Deploy
|
|
pool:
|
|
name: Hosted Ubuntu 1604
|
|
steps:
|
|
- task: DownloadBuildArtifacts@0
|
|
inputs:
|
|
artifactName: 'Manifest'
|
|
buildType: 'current'
|
|
downloadType: 'single'
|
|
downloadPath: '$(System.ArtifactsDirectory)'
|
|
- task: Kubernetes@1
|
|
inputs:
|
|
connectionType: 'Kubernetes Service Connection'
|
|
kubernetesServiceEndpoint: 'Kubernetes'
|
|
namespace: 'home-monitor'
|
|
command: 'apply'
|
|
useConfigurationFile: true
|
|
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
|
secretType: 'dockerRegistry'
|
|
containerRegistryType: 'Container Registry' |