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

Add support for building and pushing Docker images (#64)

上级 e45ed8b3
......@@ -2,6 +2,7 @@
trigger:
- master
- release-*
variables:
GOPATH: '$(system.defaultWorkingDirectory)/gopath'
......@@ -100,7 +101,6 @@ jobs:
condition: |
and
(
eq(variables['Build.SourceBranch'], 'refs/heads/master'),
eq(dependencies.build_darwin_amd64_action.result, 'Succeeded'),
eq(dependencies.build_darwin_amd64_assigner.result, 'Succeeded'),
eq(dependencies.build_darwin_amd64_controller.result, 'Succeeded'),
......@@ -116,14 +116,38 @@ jobs:
)
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download pipeline artifacts to workspace'
inputs:
buildType: 'current'
itemPattern: '**/*.zip'
targetPath: '$(Pipeline.Workspace)'
- task: AzureFileCopy@3
displayName: 'Publish archives to blob storage'
inputs:
SourcePath: '$(Pipeline.Workspace)/drop'
azureSubscription: 'Actions Releases'
Destination: 'AzureBlob'
storage: 'actionsreleases'
ContainerName: 'bin'
\ No newline at end of file
ContainerName: 'bin'
- job: 'build_and_push_amd64_docker_image'
pool:
vmImage: 'ubuntu-latest'
dependsOn:
- publish_edge_binaries
condition: |
eq(dependencies.publish_edge_binaries.result, 'Succeeded')
steps:
- template: 'build-and-push-image-template.yml'
parameters:
targetArch: amd64
- job: 'build_and_push_arm_docker_image'
pool:
vmImage: 'ubuntu-latest'
dependsOn:
- publish_edge_binaries
condition: |
eq(dependencies.publish_edge_binaries.result, 'Succeeded')
steps:
- template: 'build-and-push-image-template.yml'
parameters:
targetArch: arm
\ No newline at end of file
# actionscore/actions build and push image template
parameters:
targetArch: 'amd64'
steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download pipeline artifacts to workspace'
inputs:
buildType: 'current'
itemPattern: '**/*_linux_${{ parameters.targetArch }}.zip'
targetPath: '$(Pipeline.Workspace)'
- task: CopyFiles@2
displayName: 'Copy Dockerfile to workspace'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: 'Dockerfile'
TargetFolder: '$(Pipeline.Workspace)'
OverWrite: true
flattenFolders: true
- task: ExtractFiles@1
displayName: 'Extract linux ${{ parameters.targetArch }} binaries'
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/drop/*_linux_${{ parameters.targetArch }}.zip'
destinationFolder: '$(Pipeline.Workspace)/dist'
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
# actionscore/actions github release pipeline
variables:
ReleaseIteration: ''
ReleaseVersion: ''
ReleaseTitle: 'Actions Runtime $(ReleaseVersion) Release'
ReleaseTitle: 'Actions Runtime $(REL_VERSION) Release'
pool:
vmImage: 'macOS-latest'
......@@ -17,17 +15,17 @@ steps:
specificBuildWithTriggering: true
buildVersionToDownload: 'latest'
artifactName: 'drop'
itemPattern: '**/.zip'
itemPattern: 'drop/*.zip'
targetPath: '$(Pipeline.Workspace)'
- task: GitHubRelease@0
inputs:
gitHubConnection: 'GitHub'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(ReleaseVersion)'
target: '$(REL_VERSION)'
tagSource: 'manual'
tag: '$(ReleaseIteration)'
tag: '$(REL_ITERATION)'
title: '$(ReleaseTitle)'
assets: $(Pipeline.Workspace)
releaseNotesFile: '$(ReleaseNotesFilePath)'
releaseNotesFile: 'docs/release_notes/v$(REL_VERSION).md'
isPreRelease: true
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册