Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: cmdlib: Support deriving name from manifest, summary from image.yaml #1474

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/cmdlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,16 @@ prepare_build() {
manifest_tmp_json=${workdir}/tmp/manifest.json
rpm-ostree compose tree --repo="${tmprepo}" --print-only "${manifest}" > "${manifest_tmp_json}"

# Abuse the rojig/name as the name of the VM images
# Also grab rojig summary for image upload descriptions
name=$(jq -r '.rojig.name' < "${manifest_tmp_json}")
summary=$(jq -r '.rojig.summary' < "${manifest_tmp_json}")
if [ "$(jq -r '.rojig' < "${manifest_tmp_json}")" == "null" ]; then
name=$(basename "$(realpath "${manifest}")" .yaml)
summary=$(python3 -c 'import sys, yaml; print(yaml.safe_load(sys.stdin).get("summary"))' < "$configdir/image.yaml")
else
# Abuse the rojig/name as the name of the VM images
# Also grab rojig summary for image upload descriptions
name=$(jq -r '.rojig.name' < "${manifest_tmp_json}")
summary=$(jq -r '.rojig.summary' < "${manifest_tmp_json}")
fi

ref=$(jq -r '.ref' < "${manifest_tmp_json}")
ref_is_temp=""
if [ "${ref}" = "null" ]; then
Expand Down