Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
msftsettiy authored Jul 11, 2023
1 parent bf1414d commit e935bc8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@ perl -p -i -e 's/__MEMBER_CERTIFICATE__/$ENV{MEMBER_CERT}/g' set_member.json
# Add the member
echo "Adding the member."
content=$(ccf_cose_sign1 --ccf-gov-msg-type proposal --ccf-gov-msg-created_at `date -Is` --signing-key key --signing-cert cert --content set_member.json | curl ${CCF_URL}/gov/proposals -k -H "content-type: application/cose" --data-binary @-)
echo "Add member response content: ${content}"
proposal_id=$(echo "${content}" | jq '.proposal_id')
echo "Proposal id: ${proposal_id}"

# Vote on the proposal
content=$(ccf_cose_sign1 --ccf-gov-msg-type ballot --ccf-gov-msg-created_at `date -Is` --signing-key key --signing-cert cert --content accept.json --ccf-gov-msg-proposal_id $proposal_id| curl ${CCF_URL}/gov/proposals/$proposal_id/ballots -k -H "content-type: application/cose" --data-binary @-)
content=$(ccf_cose_sign1 --ccf-gov-msg-type ballot --ccf-gov-msg-created_at `date -Is` --signing-key key --signing-cert cert --content accept.json --ccf-gov-msg-proposal_id ${proposal_id}| curl ${CCF_URL}/gov/proposals/${proposal_id}/ballots -k -H "content-type: application/cose" --data-binary @-)
status=$(echo "${content}" | jq '.state')
echo "Vote proposal status: ${status}"

[[ $status="Accepted" ]] || ( echo "Member could not be added."; exit 1 )

Expand Down

0 comments on commit e935bc8

Please sign in to comment.