trove/backup/install.sh
Lingxian Kong 43d7aec774 Improve docker image for database backup/restore
* Decrease the image size by not installing unnecessary packages.
* Move the option 'backup_docker_image' to separate database config
  section.

Change-Id: I3362e1f8a7dc21b89c060352f2db2f138c16db07
2020-09-02 09:37:01 +12:00

27 lines
773 B
Bash
Executable File

#!/usr/bin/env bash
set -e
APTOPTS="-y -qq --no-install-recommends --allow-unauthenticated"
case "$1" in
"mysql")
curl -sSL https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb -o percona-release.deb
dpkg -i percona-release.deb
percona-release enable-only tools release
apt-get update
apt-get install $APTOPTS percona-xtrabackup-$2
apt-get clean
;;
"mariadb")
apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
add-apt-repository "deb [arch=amd64] http://mirror2.hs-esslingen.de/mariadb/repo/10.4/ubuntu $(lsb_release -cs) main"
apt-get update
apt-get install $APTOPTS mariadb-backup
apt-get clean
;;
*)
echo "datastore $1 not supported"
exit 1
;;
esac