[bitnami/containers] Use distro and arch from components (#23185)

Signed-off-by: Fran Mulero <fmulero@vmware.com>
This commit is contained in:
Fran Mulero 2023-02-07 19:14:34 +01:00 committed by GitHub
parent c03ed39474
commit 7f0902867c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -119,13 +119,15 @@ jobs:
#split by "-"
component_parts=(${component_version_full//-/ })
component_version=${component_parts[0]}
component_distro=$(jq -cr '."'${component_id}'".distro' "$components_json_file")
component_arch=$(jq -cr '."'${component_id}'".arch' "$components_json_file")
# Added "true" to avoid errors if compilation_recipe doesn't exists
compilation_recipe=$(s3cmd ls -l "s3://${AWS_S3_BUCKET}/$component_id/$component_version/$os_flavour/$arch/" | grep -c "compilation-recipe.json" || true)
compilation_recipe=$(s3cmd ls -l "s3://${AWS_S3_BUCKET}/$component_id/$component_version/$component_distro/$component_arch/" | grep -c "compilation-recipe.json" || true)
# If the components.json file, so it seems has external packages
if [[ $compilation_recipe -gt 0 ]]; then
s3cmd get "s3://${AWS_S3_BUCKET}/$component_id/$component_version/$os_flavour/$arch/compilation-recipe.json" compilation-recipe.json
s3cmd get "s3://${AWS_S3_BUCKET}/$component_id/$component_version/$component_distro/$component_arch/compilation-recipe.json" compilation-recipe.json
else
s3cmd get "s3://${AWS_S3_BUCKET}/$component_id/$component_version-${component_parts[1]}/$os_flavour/$arch/compilation-recipe.json" compilation-recipe.json
s3cmd get "s3://${AWS_S3_BUCKET}/$component_id/$component_version-${component_parts[1]}/$component_distro/$component_arch/compilation-recipe.json" compilation-recipe.json
fi
# now getting each component to be reported
while read -r json_package; do
@ -168,4 +170,4 @@ jobs:
if: ${{ steps.get-publish-metadata.outputs.result == 'ok' }}
with:
name: packages.json
path: ~/work/containers/**/osspi-packages.json
path: ~/work/containers/**/osspi-packages.json