File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 17
17
set -eo pipefail # if we do not force, we want clean exit codes on mysqldump command
18
18
fi
19
19
20
+ if [ ! -z " $GOOGLE_APPLICATION_CREDENTIALS " ]; then
21
+ /google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=$GOOGLE_APPLICATION_CREDENTIALS
22
+ fi
23
+
20
24
# verify gs config - ls bucket
21
25
$backup_tool ls " gs://${GS_URL%%/* } " > /dev/null
22
26
echo " Google storage bucket access verified."
23
27
24
28
mkdir -p /tmp/backup/
25
- rm -rf -- /tmp/backup/*
29
+ rm -rf -- /tmp/backup/*
26
30
27
31
candidates=$( echo " show databases" | mysql -u " $MYSQL_USER " -p" $MYSQL_PASSWORD " -h " $MYSQL_HOST " -P " $MYSQL_PORT " | grep -Ev " ^(Database|sys|performance_schema|information_schema)$" )
28
32
@@ -32,4 +36,4 @@ echo $?
32
36
echo " export done, now gzip output and transfer it to GCS"
33
37
34
38
gzip -v /tmp/backup/dump.sql
35
- $backup_tool $backup_options /tmp/backup/ gs://$GS_URL /
39
+ $backup_tool $backup_options /tmp/backup/ gs://$GS_URL /
You can’t perform that action at this time.
0 commit comments