snapshots: auto fix

This commit is contained in:
alex.sharov 2022-04-02 13:20:26 +07:00
parent 38ad751fa0
commit c4879dd4b8

View File

@ -29,16 +29,15 @@ cd ./../erigon-snapshot
git add "$network".toml
git commit -m "[ci]: $network, [from]: $HOSTNAME"
GH_TOKEN=""
#GH_TOKEN=""
GH_TOKEN_FILE=""
if ! gcloud -v <the_command> &> /dev/null
then
GH_TOKEN=$(gcloud secrets versions access 1 --secret="github-snapshot-push")
GH_TOKEN_FILE="~/.ssh/gh_rsa"
if [ ! type gcloud ] &>/dev/null; then
# GH_TOKEN=$(gcloud secrets versions access 1 --secret="github-snapshot-push")
GH_TOKEN_FILE="~/.ssh/vm_rsa"
fi
# /dev/null to avoid logging of insecure git output
#SSH_CMD='echo ${GH_TOKEN} | ssh -i /dev/stdin -o IdentitiesOnly=yes'
SSH_CMD="ssh -i ${GH_TOKEN_FILE} -o IdentitiesOnly=yes"
GIT_SSH_COMMAND=${SSH_CMD} git push git@github.com:ledgerwatch/erigon-snapshot.git auto > /dev/null 2>&1
echo "Done"
GIT_SSH_COMMAND=${SSH_CMD} git push git@github.com:ledgerwatch/erigon-snapshot.git auto >/dev/null 2>&1
echo "Done"