diff --git a/.pipelines/build/manifests.jobs.yaml b/.pipelines/build/manifests.jobs.yaml index b70bdeaa0b..bcecbeb2ae 100644 --- a/.pipelines/build/manifests.jobs.yaml +++ b/.pipelines/build/manifests.jobs.yaml @@ -36,3 +36,31 @@ jobs: image_repository: ${{ job_data.templateContext.name }} image_tag: ${{ job_data.templateContext.image_tag }} manifest_data: $(MANIFEST_JSON) + + - job: ${{ job_data.job }}_package_manifest + displayName: "Package Image Manifest - ${{ job_data.job }}" + dependsOn: + - ${{ job_data.job }}_publish_manifest + pool: + type: linux + variables: + LinuxContainerImage: 'mcr.microsoft.com/onebranch/azurelinux/build:3.0' + ob_outputDirectory: $(Build.SourcesDirectory)/out + ob_git_checkout: false + steps: + # Leverage new feature from https://github.com/oras-project/oras/issues/1366 in the future + # :v1 has no impact, but is required for oras + # Copy manifest from ACR + - bash: | + oras copy $(ACR).azurecr.io/$(IMAGE_REPO_PATH)/${{ job_data.templateContext.name }}:${{ job_data.templateContext.image_tag }} \ + --to-oci-layout ./${{ job_data.templateContext.image_tag }}_artifact:v1 + name: oras_copy + displayName: "Oras Copy" + + # Generate tarball + - bash: | + TARGET_DIR=$(ob_outputDirectory) + mkdir -p "$TARGET_DIR" + tar -cvzf ${TARGET_DIR}/${{ job_data.templateContext.image_tag }}_artifact.tar.gz ./${{ job_data.templateContext.image_tag }}_artifact + name: tarball + displayName: "Generate tarball"