[infra] Copycat db - Include pg_restore (#3352)
This commit is contained in:
@@ -3,6 +3,12 @@ FROM ubuntu:latest
|
||||
RUN apt-get update && apt-get install -y curl gnupg
|
||||
RUN apt-get install -y tini
|
||||
|
||||
# Install Postgres client (needed for restores, and for local testing)
|
||||
# https://www.postgresql.org/download/linux/ubuntu/
|
||||
#
|
||||
# We don't have specific dependencies on Postgres, so just use the latest.
|
||||
RUN apt-get update && apt-get -y install postgresql-client
|
||||
|
||||
# Install SCW CLI
|
||||
# Latest release: https://github.com/scaleway/scaleway-cli/releases/latest
|
||||
RUN \
|
||||
|
||||
@@ -18,9 +18,10 @@ EXPIRY="$(date -Iseconds --utc --date "@$EXPIRYS")"
|
||||
|
||||
if test -z "$SCW_RDB_INSTANCE_ID"
|
||||
then
|
||||
# A required SCW related environment variable hasn't been specified.
|
||||
echo "Missing SCW_RDB_INSTANCE_ID"
|
||||
exit 1
|
||||
# A required SCW related environment variable hasn't been specified. This is
|
||||
# expected when running the script locally for testing. Fallback to using
|
||||
# pg_dump for creating the backup.
|
||||
pg_dump -Fc ente_db > $BACKUP_FILE
|
||||
else
|
||||
# We need to export a backup first after creating it, before it can be
|
||||
# downloaded.
|
||||
|
||||
Reference in New Issue
Block a user