Skip to content

Commit 1442b9e

Browse files
authored
ci: output manifest tarball with Oras (#3698)
* ci: output manifest tarball * chore: reset file * test: ob var
1 parent 8c23d7c commit 1442b9e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.pipelines/build/manifests.jobs.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,31 @@ jobs:
3636
image_repository: ${{ job_data.templateContext.name }}
3737
image_tag: ${{ job_data.templateContext.image_tag }}
3838
manifest_data: $(MANIFEST_JSON)
39+
40+
- job: ${{ job_data.job }}_package_manifest
41+
displayName: "Package Image Manifest - ${{ job_data.job }}"
42+
dependsOn:
43+
- ${{ job_data.job }}_publish_manifest
44+
pool:
45+
type: linux
46+
variables:
47+
LinuxContainerImage: 'mcr.microsoft.com/onebranch/azurelinux/build:3.0'
48+
ob_outputDirectory: $(Build.SourcesDirectory)/out
49+
ob_git_checkout: false
50+
steps:
51+
# Leverage new feature from https://github.com/oras-project/oras/issues/1366 in the future
52+
# :v1 has no impact, but is required for oras
53+
# Copy manifest from ACR
54+
- bash: |
55+
oras copy $(ACR).azurecr.io/$(IMAGE_REPO_PATH)/${{ job_data.templateContext.name }}:${{ job_data.templateContext.image_tag }} \
56+
--to-oci-layout ./${{ job_data.templateContext.image_tag }}_artifact:v1
57+
name: oras_copy
58+
displayName: "Oras Copy"
59+
60+
# Generate tarball
61+
- bash: |
62+
TARGET_DIR=$(ob_outputDirectory)
63+
mkdir -p "$TARGET_DIR"
64+
tar -cvzf ${TARGET_DIR}/${{ job_data.templateContext.image_tag }}_artifact.tar.gz ./${{ job_data.templateContext.image_tag }}_artifact
65+
name: tarball
66+
displayName: "Generate tarball"

0 commit comments

Comments
 (0)