helm: Convert the SSO server to be served over SSL.
[arvados-k8s.git] / arvados / config / postgres / create_dbs.sh
1 #!/bin/bash
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 function create_user_and_database() {
7   local database=$1
8   local user=$2
9   local password=$3
10   echo "Creating database '$database'"
11   psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
12       CREATE USER $user WITH CREATEDB PASSWORD '$password';
13       CREATE DATABASE $database OWNER $user;
14 EOSQL
15 }
16
17 create_user_and_database arvados_sso_production arvados_sso pw
18 create_user_and_database arvados_production arvados pw