Short answer: Either you have the keys on remote and you just forgot the ticks 'EOF' OR you have the keys on locale and vainly hope this is way to transfer the key over to the remote. In the second case transfer,transfer your key to remote by some other secure way (like scp -p) or upload your remote public identity key (assuming you generated one already) to bitbucket.
Long answer:
Just type ssh-agent see to what is happening here.
(Or
cat << EOF
echo Would do remotely eval $(ssh-agent)
echo Would do remotely ssh-add ~/route/to/key
echo -------------
EOF
or
ssh -i"${BUILDHOSTKEY}" "${BUILDHOSTUSERNAME}"@"${BUILDHOSTNAME}" << EOF
echo WOULD DO eval $(ssh-agent)
echo WOULD DO ssh-add ~/route/to/key
EOF
in the case you feel I am suggesting unrelated nonsense.)
The output contains something like
SSH_AUTH_SOCK=/tmp/ssh-XXXXXXEEUQSV/agent.43806
which is Unix domain socket address of your ssh-agent on the local machine. This is local to your machine and does not exist (hopefully!) on the remote machine.
Such socket file does not exist on both of the machines.
May be you wanted to write
# Note ' ' on the following line -----------------here-------------\--\
ssh -i"${BUILDHOSTKEY}" "${BUILDHOSTUSERNAME}"@"${BUILDHOSTNAME}" << 'EOF'
eval $(ssh-agent)
ssh-add ~/route/to/key
... rest of build script ...
EOF
if ~/route/to/key is valid on the remote machine.
Remark. If you know what you are doing, you could try also something like ssh-agent bash -c 'ssh-add ~/route/to/key; ssh -A -i"${BUILDHOSTKEY}" "${BUILDHOSTUSERNAME}"@"${BUILDHOSTNAME}"'