feat: add db users
This commit is contained in:
@@ -18,7 +18,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GIT_REFERENCE: ${{ github.ref }}
|
GIT_REFERENCE: ${{ github.ref }}
|
||||||
- name: Build rpm package
|
- name: Build rpm package
|
||||||
run: rpmbuild -ba "%(make name).spec"
|
run: rpmbuild -ba "$(make name).spec"
|
||||||
- name: Upload rpm package
|
- name: Upload rpm package
|
||||||
run: make upload
|
run: make upload
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ Install the database management system called postgresql with a predefined confi
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
# Create databases and users from DB_USERS variable (separator is ",") if not existing
|
# Create databases and users from DB_USERS variable (separator is ",") if not existing
|
||||||
echo "$DB_USERS" | IFS="," read -ra users
|
IFS="," read -ra users <<<"$DB_USERS";
|
||||||
for user in "${users[@]}"; do
|
for user in "${users[@]}"; do
|
||||||
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --invert-match postgres | grep --quiet "$user"; then
|
if ! runuser --user=postgres -- psql --quiet --tuples-only --command='\du' | grep --invert-match postgres | grep --quiet "$user"; then
|
||||||
runuser --user=postgres -- createuser "$user"
|
runuser --user=postgres -- createuser "$user"
|
||||||
|
|||||||
Reference in New Issue
Block a user