Skip to content

Commit

Permalink
Fix update_connection.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
  • Loading branch information
mbrandenburger committed Jul 23, 2024
1 parent 3f10103 commit 722f1a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions samples/deployment/test-network/update-connection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ for org in "${orgs[@]}"; do
yq ".organizations.${org^}.users.${user}.cert.path = \"${CERTS[0]}\"" -i "${CONNECTIONS_PATH}"
yq ".organizations.${org^}.users.${user}.key.path = \"${KEYS[0]}\"" -i "${CONNECTIONS_PATH}"

# add channels and entity matcher
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' -i ${CONNECTIONS_PATH} <<EOF
# Create temporary file with channels and entity matchers
temp_yaml=$(mktemp -t temp-XXXXXXXXXX.yaml --tmpdir="${tmp_dir}")
cat > "${temp_yaml}" <<EOF
channels:
_default:
peers:
Expand All @@ -75,6 +75,9 @@ entityMatchers:
mappedHost: \${1}
EOF

# add channels and entity matcher
yq eval-all 'select(fileIndex == 0) * select(fileIndex == 1)' -i "${CONNECTIONS_PATH}" "${temp_yaml}"

# fetch all peers from connections
yq ".peers" "${CONNECTIONS_PATH}" >> "${tmp_dir}/peers-${org}.yaml"
done
Expand Down

0 comments on commit 722f1a5

Please sign in to comment.