databases initializer script
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
All checks were successful
gitea.arg.rip/deployment/pipeline/head This commit looks good
I think I figured it out. your -s << 'ENDMARKER' is looking for a line that starts with ENDMARKER - no spaces. so you can't indent it nicely.
This commit is contained in:
parent
84c023783f
commit
9b70bd9480
19
scripts/databases.sh
Normal file
19
scripts/databases.sh
Normal file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
SUDOER_PSW=
|
||||
pw_productiondatabase=
|
||||
pw_developmentdatabase=
|
||||
servicename=
|
||||
service_dev="${servicename}_dev"
|
||||
|
||||
echo "${SUDOER_PSW}" | sudo -Su postgres psql && bash -s << 'ENDPSQL'
|
||||
create database $servicename;
|
||||
create user $servicename with encrypted password '$pw_productiondatabase';
|
||||
grant all privileges on database $servicename to $servicename;
|
||||
|
||||
create database $service_dev;
|
||||
create user $service_dev with encrypted password '$pw_developmentdatabase';
|
||||
grant all privileges on database $service_dev to $service_dev;
|
||||
ENDPSQL
|
||||
|
||||
exit
|
Loading…
Reference in New Issue
Block a user