diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c3da98967..1429f950c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -18,6 +18,13 @@ variables: - name: 'BuildUniqueID' value: '$(Build.BuildID)-$(Agent.Id)-$(System.DefinitionId)-$(System.JobId)' - group: 'GithubCMF' + # Docker Tag Variablen + - name: 'DockerTagSourceBranch' + value: $[replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), '/', '_')] + - name: 'CommitHash' + value: $[replace(variables['Build.SourceVersion'], format('{0}-', variables['Build.SourceBranchName']), '')] + - name: 'DockerTag' + value: '$(Major).$(Minor).$(Patch)-$(DockerTagSourceBranch)-$(CommitHash)' jobs: - job: unittests @@ -87,13 +94,6 @@ 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' @@ -156,13 +156,6 @@ 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'