mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-02-07 17:24:50 -05:00
Switch to multi-stage build/deploy
This commit is contained in:
@@ -9,35 +9,58 @@ trigger:
|
|||||||
include:
|
include:
|
||||||
- Display
|
- Display
|
||||||
|
|
||||||
pool:
|
stages:
|
||||||
name: Hosted Ubuntu 1604
|
- 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: 'Display/Dockerfile'
|
||||||
|
imageName: 'ckaczor/home-monitor-display:$(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-display:$(Build.BuildNumber)'
|
||||||
|
includeLatestTag: true
|
||||||
|
- task: Bash@3
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Display/deploy/manifest.yaml'
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: 'Display/deploy/manifest.yaml'
|
||||||
|
ArtifactName: 'Manifest'
|
||||||
|
publishLocation: 'Container'
|
||||||
|
|
||||||
steps:
|
- stage: Deploy
|
||||||
- task: Docker@0
|
jobs:
|
||||||
displayName: 'Build an image'
|
- job: Deploy
|
||||||
inputs:
|
pool:
|
||||||
containerregistrytype: 'Container Registry'
|
name: Hosted Ubuntu 1604
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
steps:
|
||||||
dockerFile: 'Display/Dockerfile'
|
- task: DownloadBuildArtifacts@0
|
||||||
imageName: 'ckaczor/home-monitor-display:$(Build.BuildNumber)'
|
inputs:
|
||||||
includeLatestTag: true
|
artifactName: 'Manifest'
|
||||||
|
buildType: 'current'
|
||||||
- task: Docker@0
|
downloadType: 'single'
|
||||||
displayName: 'Push an image'
|
downloadPath: '$(System.ArtifactsDirectory)'
|
||||||
inputs:
|
- task: Kubernetes@1
|
||||||
containerregistrytype: 'Container Registry'
|
inputs:
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
connectionType: 'Kubernetes Service Connection'
|
||||||
action: 'Push an image'
|
kubernetesServiceEndpoint: 'Kubernetes'
|
||||||
imageName: 'ckaczor/home-monitor-display:$(Build.BuildNumber)'
|
namespace: 'home-monitor'
|
||||||
includeLatestTag: true
|
command: 'apply'
|
||||||
|
useConfigurationFile: true
|
||||||
- task: Bash@3
|
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
||||||
inputs:
|
secretType: 'dockerRegistry'
|
||||||
targetType: 'inline'
|
containerRegistryType: 'Container Registry'
|
||||||
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Display/deploy/manifest.yaml'
|
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
|
||||||
inputs:
|
|
||||||
PathtoPublish: 'Display/deploy/manifest.yaml'
|
|
||||||
ArtifactName: 'Manifest'
|
|
||||||
publishLocation: 'Container'
|
|
||||||
|
|||||||
@@ -9,35 +9,58 @@ trigger:
|
|||||||
include:
|
include:
|
||||||
- Hub/Service
|
- Hub/Service
|
||||||
|
|
||||||
pool:
|
stages:
|
||||||
name: Hosted Ubuntu 1604
|
- stage: Build
|
||||||
|
jobs:
|
||||||
steps:
|
- job: Build
|
||||||
- task: Docker@0
|
pool:
|
||||||
displayName: 'Build an image'
|
name: Hosted Ubuntu 1604
|
||||||
inputs:
|
steps:
|
||||||
containerregistrytype: 'Container Registry'
|
- task: Docker@0
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
displayName: 'Build an image'
|
||||||
dockerFile: 'Hub/Service/Dockerfile'
|
inputs:
|
||||||
imageName: 'ckaczor/home-monitor-hub-service:$(Build.BuildNumber)'
|
containerregistrytype: 'Container Registry'
|
||||||
includeLatestTag: true
|
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'
|
||||||
|
|
||||||
- task: Docker@0
|
- stage: Deploy
|
||||||
displayName: 'Push an image'
|
jobs:
|
||||||
inputs:
|
- job: Deploy
|
||||||
containerregistrytype: 'Container Registry'
|
pool:
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
name: Hosted Ubuntu 1604
|
||||||
action: 'Push an image'
|
steps:
|
||||||
imageName: 'ckaczor/home-monitor-hub-service:$(Build.BuildNumber)'
|
- task: DownloadBuildArtifacts@0
|
||||||
includeLatestTag: true
|
inputs:
|
||||||
|
artifactName: 'Manifest'
|
||||||
- task: Bash@3
|
buildType: 'current'
|
||||||
inputs:
|
downloadType: 'single'
|
||||||
targetType: 'inline'
|
downloadPath: '$(System.ArtifactsDirectory)'
|
||||||
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Hub/Service/deploy/manifest.yaml'
|
- task: Kubernetes@1
|
||||||
|
inputs:
|
||||||
- task: PublishBuildArtifacts@1
|
connectionType: 'Kubernetes Service Connection'
|
||||||
inputs:
|
kubernetesServiceEndpoint: 'Kubernetes'
|
||||||
PathtoPublish: 'Hub/Service/deploy/manifest.yaml'
|
namespace: 'home-monitor'
|
||||||
ArtifactName: 'Manifest'
|
command: 'apply'
|
||||||
publishLocation: 'Container'
|
useConfigurationFile: true
|
||||||
|
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
||||||
|
secretType: 'dockerRegistry'
|
||||||
|
containerRegistryType: 'Container Registry'
|
||||||
@@ -63,4 +63,4 @@ stages:
|
|||||||
useConfigurationFile: true
|
useConfigurationFile: true
|
||||||
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
||||||
secretType: 'dockerRegistry'
|
secretType: 'dockerRegistry'
|
||||||
containerRegistryType: 'Azure Container Registry'
|
containerRegistryType: 'Container Registry'
|
||||||
@@ -9,35 +9,58 @@ trigger:
|
|||||||
include:
|
include:
|
||||||
- Weather/SerialReader
|
- Weather/SerialReader
|
||||||
|
|
||||||
pool:
|
stages:
|
||||||
name: Hosted Ubuntu 1604
|
- stage: Build
|
||||||
|
jobs:
|
||||||
steps:
|
- job: Build
|
||||||
- task: Docker@0
|
pool:
|
||||||
displayName: 'Build an image'
|
name: Hosted Ubuntu 1604
|
||||||
inputs:
|
steps:
|
||||||
containerregistrytype: 'Container Registry'
|
- task: Docker@0
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
displayName: 'Build an image'
|
||||||
dockerFile: 'Weather/SerialReader/Dockerfile'
|
inputs:
|
||||||
imageName: 'ckaczor/home-monitor-weather-serialreader:$(Build.BuildNumber)'
|
containerregistrytype: 'Container Registry'
|
||||||
includeLatestTag: true
|
dockerRegistryConnection: 'Docker Hub'
|
||||||
|
dockerFile: 'Weather/SerialReader/Dockerfile'
|
||||||
|
imageName: 'ckaczor/home-monitor-weather-serialreader:$(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-weather-serialreader:$(Build.BuildNumber)'
|
||||||
|
includeLatestTag: true
|
||||||
|
- task: Bash@3
|
||||||
|
inputs:
|
||||||
|
targetType: 'inline'
|
||||||
|
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Weather/SerialReader/deploy/manifest.yaml'
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: 'Weather/SerialReader/deploy/manifest.yaml'
|
||||||
|
ArtifactName: 'Manifest'
|
||||||
|
publishLocation: 'Container'
|
||||||
|
|
||||||
- task: Docker@0
|
- stage: Deploy
|
||||||
displayName: 'Push an image'
|
jobs:
|
||||||
inputs:
|
- job: Deploy
|
||||||
containerregistrytype: 'Container Registry'
|
pool:
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
name: Hosted Ubuntu 1604
|
||||||
action: 'Push an image'
|
steps:
|
||||||
imageName: 'ckaczor/home-monitor-weather-serialreader:$(Build.BuildNumber)'
|
- task: DownloadBuildArtifacts@0
|
||||||
includeLatestTag: true
|
inputs:
|
||||||
|
artifactName: 'Manifest'
|
||||||
- task: Bash@3
|
buildType: 'current'
|
||||||
inputs:
|
downloadType: 'single'
|
||||||
targetType: 'inline'
|
downloadPath: '$(System.ArtifactsDirectory)'
|
||||||
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Weather/SerialReader/deploy/manifest.yaml'
|
- task: Kubernetes@1
|
||||||
|
inputs:
|
||||||
- task: PublishBuildArtifacts@1
|
connectionType: 'Kubernetes Service Connection'
|
||||||
inputs:
|
kubernetesServiceEndpoint: 'Kubernetes'
|
||||||
PathtoPublish: 'Weather/SerialReader/deploy/manifest.yaml'
|
namespace: 'home-monitor'
|
||||||
ArtifactName: 'Manifest'
|
command: 'apply'
|
||||||
publishLocation: 'Container'
|
useConfigurationFile: true
|
||||||
|
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
|
||||||
|
secretType: 'dockerRegistry'
|
||||||
|
containerRegistryType: 'Container Registry'
|
||||||
@@ -9,35 +9,62 @@ trigger:
|
|||||||
include:
|
include:
|
||||||
- Weather/Service
|
- Weather/Service
|
||||||
|
|
||||||
pool:
|
stages:
|
||||||
name: Hosted Ubuntu 1604
|
- stage: Build
|
||||||
|
jobs:
|
||||||
steps:
|
- job: Build
|
||||||
- task: Docker@0
|
pool:
|
||||||
displayName: 'Build an image'
|
name: Hosted Ubuntu 1604
|
||||||
inputs:
|
|
||||||
containerregistrytype: 'Container Registry'
|
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
|
||||||
dockerFile: 'Weather/Service/Dockerfile'
|
|
||||||
imageName: 'ckaczor/home-monitor-weather-service:$(Build.BuildNumber)'
|
|
||||||
includeLatestTag: true
|
|
||||||
|
|
||||||
- task: Docker@0
|
steps:
|
||||||
displayName: 'Push an image'
|
- task: Docker@0
|
||||||
inputs:
|
displayName: 'Build an image'
|
||||||
containerregistrytype: 'Container Registry'
|
inputs:
|
||||||
dockerRegistryConnection: 'Docker Hub'
|
containerregistrytype: 'Container Registry'
|
||||||
action: 'Push an image'
|
dockerRegistryConnection: 'Docker Hub'
|
||||||
imageName: 'ckaczor/home-monitor-weather-service:$(Build.BuildNumber)'
|
dockerFile: 'Weather/Service/Dockerfile'
|
||||||
includeLatestTag: true
|
imageName: 'ckaczor/home-monitor-weather-service:$(Build.BuildNumber)'
|
||||||
|
includeLatestTag: true
|
||||||
|
|
||||||
- task: Bash@3
|
- task: Docker@0
|
||||||
inputs:
|
displayName: 'Push an image'
|
||||||
targetType: 'inline'
|
inputs:
|
||||||
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Weather/Service/deploy/manifest.yaml'
|
containerregistrytype: 'Container Registry'
|
||||||
|
dockerRegistryConnection: 'Docker Hub'
|
||||||
|
action: 'Push an image'
|
||||||
|
imageName: 'ckaczor/home-monitor-weather-service:$(Build.BuildNumber)'
|
||||||
|
includeLatestTag: true
|
||||||
|
|
||||||
- task: PublishBuildArtifacts@1
|
- task: Bash@3
|
||||||
inputs:
|
inputs:
|
||||||
PathtoPublish: 'Weather/Service/deploy/manifest.yaml'
|
targetType: 'inline'
|
||||||
ArtifactName: 'Manifest'
|
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ Weather/Service/deploy/manifest.yaml'
|
||||||
publishLocation: 'Container'
|
|
||||||
|
- task: PublishBuildArtifacts@1
|
||||||
|
inputs:
|
||||||
|
PathtoPublish: 'Weather/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'
|
||||||
Reference in New Issue
Block a user