mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1529: Floating Docker Branch-Tags
Es wird zusätzlich zu den bisherigen Docker-Tags, ein Docker-Tag vergeben, das den aktuellen Branch repräsentiert. Da dieses (identische) Tag für jeden neuen Build aus einem Branch wieder vergeben wird, wandert das Tag auf das neueste Docker-Image aus diesem Branch (vgl. Tag _latest_)
Beispiele:
develop => refs_head_develop
release/2.3 => refs_head_release_2.3
(cherry picked from commit 8880ed0df6)
This commit is contained in:
@@ -20,27 +20,7 @@ variables:
|
||||
- group: 'GithubCMF'
|
||||
|
||||
jobs:
|
||||
# - job: cibuild_fast
|
||||
# displayName: ISAClient CI Fast
|
||||
# pool:
|
||||
# name: 'Default'
|
||||
# demands:
|
||||
# - Agent.OS -equals Linux
|
||||
# - docker
|
||||
# condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/develop'), ne(variables['Build.SourceBranch'], 'refs/heads/integration'), ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
|
||||
# steps:
|
||||
# - task: npmAuthenticate@0
|
||||
# displayName: 'npm auth'
|
||||
# inputs:
|
||||
# workingFile: .npmrc
|
||||
# - task: Docker@2
|
||||
# displayName: 'build ISAClient Debug'
|
||||
# inputs:
|
||||
# command: 'build'
|
||||
# Dockerfile: Dockerfile
|
||||
# buildContext:
|
||||
# tags: '$(Build.BuildNumber)-$(Build.SourceVersion)'
|
||||
# arguments: '--build-arg SEMVERSION=$(Major).$(Minor).$(Patch)'
|
||||
|
||||
- job: unittests
|
||||
displayName: Unit Tests
|
||||
pool:
|
||||
@@ -99,6 +79,7 @@ jobs:
|
||||
fi
|
||||
displayName: Remove docker image
|
||||
condition: always()
|
||||
|
||||
- job: cibuild_debug
|
||||
displayName: ISAClient CI Debug
|
||||
pool:
|
||||
@@ -107,7 +88,15 @@ jobs:
|
||||
- Agent.OS -equals Linux
|
||||
- docker
|
||||
condition: and(ne(variables['Build.SourceBranch'], 'refs/heads/integration'), ne(variables['Build.SourceBranch'], 'refs/heads/master'), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')), not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))
|
||||
variables:
|
||||
- name: DockerTagSourceBranch
|
||||
value: $[replace(variables['Build.SourceBranch'], '/', '_')]
|
||||
- name: 'DockerTag'
|
||||
value: |
|
||||
$(Build.BuildNumber)-$(Build.SourceVersion)
|
||||
$(DockerTagSourceBranch)
|
||||
steps:
|
||||
|
||||
- task: npmAuthenticate@0
|
||||
displayName: 'npm auth'
|
||||
inputs:
|
||||
@@ -121,7 +110,7 @@ jobs:
|
||||
command: 'build'
|
||||
Dockerfile: Dockerfile
|
||||
buildContext:
|
||||
tags: '$(Build.BuildNumber)-$(Build.SourceVersion)'
|
||||
tags: '$(DockerTag)'
|
||||
arguments: |
|
||||
--no-cache
|
||||
--target publish
|
||||
@@ -135,7 +124,7 @@ jobs:
|
||||
containerRegistry: 'Harbor isa'
|
||||
repository: 'isa/ui'
|
||||
command: 'push'
|
||||
tags: '$(Build.BuildNumber)-$(Build.SourceVersion)'
|
||||
tags: '$(DockerTag)'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Artefakt veröffentlichen: HelmValues'
|
||||
@@ -169,6 +158,13 @@ jobs:
|
||||
- Agent.OS -equals Linux
|
||||
- docker
|
||||
condition: or(eq(variables['Build.SourceBranch'], 'refs/heads/integration'), eq(variables['Build.SourceBranch'], 'refs/heads/master'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
|
||||
variables:
|
||||
- name: DockerTagSourceBranch
|
||||
value: $[replace(variables['Build.SourceBranch'], '/', '_')]
|
||||
- name: 'DockerTag'
|
||||
value: |
|
||||
$(Build.BuildNumber)-$(Build.SourceVersion)
|
||||
$(DockerTagSourceBranch)
|
||||
steps:
|
||||
- task: npmAuthenticate@0
|
||||
displayName: 'npm auth'
|
||||
@@ -183,7 +179,7 @@ jobs:
|
||||
command: 'build'
|
||||
Dockerfile: Dockerfile
|
||||
buildContext:
|
||||
tags: '$(Build.BuildNumber)-$(Build.SourceVersion)'
|
||||
tags: '$(DockerTag)'
|
||||
arguments: |
|
||||
--no-cache
|
||||
--target publish
|
||||
@@ -198,7 +194,7 @@ jobs:
|
||||
containerRegistry: 'Harbor isa'
|
||||
repository: 'isa/ui'
|
||||
command: 'push'
|
||||
tags: '$(Build.BuildNumber)-$(Build.SourceVersion)'
|
||||
tags: '$(DockerTag)'
|
||||
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
|
||||
Reference in New Issue
Block a user