Skip to content
This repository has been archived by the owner on Feb 11, 2020. It is now read-only.

Commit

Permalink
use metadata as YAML, rather than a greppable value [#163398392]
Browse files Browse the repository at this point in the history
  • Loading branch information
JT Archie committed Jan 24, 2019
1 parent 99ae912 commit 4073351
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tasks/stage-product/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ STAGED=$(om-linux \
FILE_PATH=`find ./pivnet-product -name *.pivotal | sort | head -1`
unzip $FILE_PATH metadata/*

PRODUCT_NAME="$(cat metadata/*.yml | grep '^name' | cut -d' ' -f 2)"
desired_version="$(cat metadata/*.yml | grep '^product_version' | cut -d' ' -f 2)"
metadata_json=$(ruby -ryaml -rjson -e 'puts YAML.load_file(Dir["metadata/*.yml"].first).to_json')

PRODUCT_NAME="$(echo "$metadata_json" | jq -r .name)"
desired_version="$(echo "$metadata_json" | jq -r .product_version)"

# Figure out which products are unstaged.
UNSTAGED_ALL=$(jq -n --argjson available "$AVAILABLE" --argjson staged "$STAGED" \
Expand Down

0 comments on commit 4073351

Please sign in to comment.