未验证 提交 500fad1d 编写于 作者: L Luke Kim 提交者: GitHub

Better tagging of Docker image tags and versioned blob paths (#67)

上级 7924b2ae
......@@ -115,6 +115,8 @@ jobs:
eq(dependencies.build_windows_amd64_controller.result, 'Succeeded')
)
steps:
- script: echo '##vso[task.setvariable variable=BlobPrefix]$(Build.SourceBranchName)/$(REL_VERSION)
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release-'))
- task: DownloadPipelineArtifact@2
displayName: 'Download pipeline artifacts to workspace'
inputs:
......@@ -124,12 +126,16 @@ jobs:
- task: AzureFileCopy@3
displayName: 'Publish archives to blob storage'
inputs:
SourcePath: '$(Pipeline.Workspace)/drop'
azureSubscription: 'Actions Releases'
Destination: 'AzureBlob'
storage: 'actionsreleases'
ContainerName: 'bin'
SourcePath: '$(Pipeline.Workspace)/drop'
azureSubscription: 'Actions Releases'
Destination: 'AzureBlob'
storage: 'actionsreleases'
ContainerName: 'bin'
blobPrefix: '$(BlobPrefix)'
- job: 'build_and_push_amd64_docker_image'
variables:
DockerVersionTag: ''
DockerReleaseTag: ''
pool:
vmImage: 'ubuntu-latest'
dependsOn:
......@@ -141,6 +147,9 @@ jobs:
parameters:
targetArch: amd64
- job: 'build_and_push_arm_docker_image'
variables:
DockerVersionTag: ''
DockerReleaseTag: ''
pool:
vmImage: 'ubuntu-latest'
dependsOn:
......
......@@ -4,6 +4,25 @@ parameters:
targetArch: 'amd64'
steps:
- script: |
echo '##vso[task.setvariable variable=DockerVersionTag]$(Build.SourceBranchName)'
condition: not(startsWith(variables['Build.SourceBranch'], 'refs/heads/release-'))
- script: |
echo '##vso[task.setvariable variable=DockerReleaseTag]latest'
echo '##vso[task.setvariable variable=DockerVersionTag]v$(REL_VERSION)'
condition: |
and(
eq('${{ parameters.targetArch }}', 'amd64'),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release-')
)
- script: |
echo '##vso[task.setvariable variable=DockerReleaseTag]latest-${{ parameters.targetArch }}'
echo '##vso[task.setvariable variable=DockerVersionTag]v$(REL_VERSION)-${{ parameters.targetArch }}'
condition: |
and(
ne('${{ parameters.targetArch }}', 'amd64'),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release-')
)
- task: DownloadPipelineArtifact@2
displayName: 'Download pipeline artifacts to workspace'
inputs:
......@@ -26,19 +45,11 @@ steps:
cleanDestinationFolder: false
- task: Docker@2
displayName: 'Build and push ${{ parameters.targetArch }} Docker image'
condition: eq('${{ parameters.targetArch }}', 'amd64')
inputs:
containerRegistry: 'ACR Actions Core'
repository: 'actions'
command: 'buildAndPush'
Dockerfile: '$(Pipeline.Workspace)/Dockerfile'
tags: 'latest'
- task: Docker@2
displayName: 'Build and push ${{ parameters.targetArch }} Docker image'
condition: ne('${{ parameters.targetArch }}', 'amd64')
inputs:
containerRegistry: 'ACR Actions Core'
repository: 'actions'
command: 'buildAndPush'
Dockerfile: '$(Pipeline.Workspace)/Dockerfile'
tags: 'latest-${{ parameters.targetArch }}'
\ No newline at end of file
tags: |
$(DockerVersionTag)
$(DockerReleaseTag)
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册