Try to fix tags on build (push seems okay)

This commit is contained in:
2025-02-10 22:35:59 +00:00
parent 4bf3fe204c
commit d8096e92f0

View File

@@ -3,93 +3,94 @@ name: $(Rev:r)
pr: none pr: none
trigger: trigger:
batch: 'true' batch: 'true'
branches: branches:
include: include:
- master - master
paths: paths:
include: include:
- WebDisplay - WebDisplay
stages: stages:
- stage: Build - stage: Build
jobs: jobs:
- job: Build - job: Build
pool: pool:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
steps: steps:
- task: Docker@2 - task: Docker@2
displayName: 'Build an image' displayName: 'Build an image'
inputs: inputs:
command: 'build' command: 'build'
containerRegistry: 'Docker Hub' containerRegistry: 'Docker Hub'
dockerFile: 'WebDisplay/Dockerfile' dockerFile: 'WebDisplay/Dockerfile'
tags: '$(Build.BuildNumber)' repository: 'ckaczor/home-monitor-web-display'
- task: Docker@2 tags: '$(Build.BuildNumber)'
displayName: 'Push an image' - task: Docker@2
inputs: displayName: 'Push an image'
command: 'push' inputs:
containerRegistry: 'Docker Hub' command: 'push'
repository: 'ckaczor/home-monitor-web-display' containerRegistry: 'Docker Hub'
tags: '$(Build.BuildNumber)' repository: 'ckaczor/home-monitor-web-display'
- task: Bash@3 tags: '$(Build.BuildNumber)'
inputs: - task: Bash@3
targetType: 'inline' inputs:
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ WebDisplay/deploy/manifest.yaml' targetType: 'inline'
- task: PublishBuildArtifacts@1 script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ WebDisplay/deploy/manifest.yaml'
inputs: - task: PublishBuildArtifacts@1
PathtoPublish: 'WebDisplay/deploy/manifest.yaml' inputs:
ArtifactName: 'Manifest' PathtoPublish: 'WebDisplay/deploy/manifest.yaml'
publishLocation: 'Container' ArtifactName: 'Manifest'
- task: Bash@3 publishLocation: 'Container'
inputs: - task: Bash@3
targetType: 'inline' inputs:
script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ WebDisplay/deploy/manifest-internal.yaml' targetType: 'inline'
- task: PublishBuildArtifacts@1 script: 'sed -i s/#BUILD_BUILDNUMBER#/$BUILD_BUILDNUMBER/ WebDisplay/deploy/manifest-internal.yaml'
inputs: - task: PublishBuildArtifacts@1
PathtoPublish: 'WebDisplay/deploy/manifest-internal.yaml' inputs:
ArtifactName: 'Manifest-Internal' PathtoPublish: 'WebDisplay/deploy/manifest-internal.yaml'
publishLocation: 'Container' ArtifactName: 'Manifest-Internal'
publishLocation: 'Container'
- stage: Deploy - stage: Deploy
jobs: jobs:
- job: Deploy - job: Deploy
pool: pool:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
steps: steps:
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
inputs: inputs:
artifactName: 'Manifest' artifactName: 'Manifest'
buildType: 'current' buildType: 'current'
downloadType: 'single' downloadType: 'single'
downloadPath: '$(System.ArtifactsDirectory)' downloadPath: '$(System.ArtifactsDirectory)'
- task: Kubernetes@1 - task: Kubernetes@1
inputs: inputs:
connectionType: 'Kubernetes Service Connection' connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'Kubernetes' kubernetesServiceEndpoint: 'Kubernetes'
namespace: 'home-monitor' namespace: 'home-monitor'
command: 'apply' command: 'apply'
useConfigurationFile: true useConfigurationFile: true
configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml' configuration: '$(System.ArtifactsDirectory)/Manifest/manifest.yaml'
secretType: 'dockerRegistry' secretType: 'dockerRegistry'
containerRegistryType: 'Container Registry' containerRegistryType: 'Container Registry'
- job: Deploy_Internal - job: Deploy_Internal
pool: pool:
vmImage: 'ubuntu-latest' vmImage: 'ubuntu-latest'
steps: steps:
- task: DownloadBuildArtifacts@0 - task: DownloadBuildArtifacts@0
inputs: inputs:
artifactName: 'Manifest-Internal' artifactName: 'Manifest-Internal'
buildType: 'current' buildType: 'current'
downloadType: 'single' downloadType: 'single'
downloadPath: '$(System.ArtifactsDirectory)' downloadPath: '$(System.ArtifactsDirectory)'
- task: Kubernetes@1 - task: Kubernetes@1
inputs: inputs:
connectionType: 'Kubernetes Service Connection' connectionType: 'Kubernetes Service Connection'
kubernetesServiceEndpoint: 'Kubernetes' kubernetesServiceEndpoint: 'Kubernetes'
namespace: 'home-monitor' namespace: 'home-monitor'
command: 'apply' command: 'apply'
useConfigurationFile: true useConfigurationFile: true
configuration: '$(System.ArtifactsDirectory)/Manifest-Internal/manifest-internal.yaml' configuration: '$(System.ArtifactsDirectory)/Manifest-Internal/manifest-internal.yaml'
secretType: 'dockerRegistry' secretType: 'dockerRegistry'
containerRegistryType: 'Container Registry' containerRegistryType: 'Container Registry'