blob: 07cb0d9b9bde2ef4c3171802da2375c309e1f173 [file] [log] [blame]
set -e
# Authenticate using the credentials provided at GOOGLE_APPLICATION_CREDENTIALS.
gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
# Dump the tables we want backed up and copy the gzipped output to Google Cloud Storage.
for config in "${CONFIGS[@]}"
echo "Backing up $config"
/usr/local/bin/perf-tool database backup alerts \
--config_filename=/usr/local/share/skiaperf/configs/$config --out=/tmp/alerts.dat
# Defaults to backing up one month.
/usr/local/bin/perf-tool database backup regressions \
--config_filename=/usr/local/share/skiaperf/configs/$config --out=/tmp/regressions.dat
gsutil cp /tmp/alerts.dat gs://skia-public-backup/perf/$(date +%Y)/$(date +%m)/$(date +%d)/$config/alerts.dat
gsutil cp /tmp/regressions.dat gs://skia-public-backup/perf/$(date +%Y)/$(date +%m)/$(date +%d)/$config/regressions.dat
# Running this script as a CronJob is reported as an error, but looking at the
# logs it always succeeds, so try forcing a happy exit code.
exit 0