[DRE-commits] [gitlab] 02/16: Patch by Benjamin Drung
Praveen Arimbrathodiyil
praveen at moszumanska.debian.org
Thu Feb 16 12:09:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
praveen pushed a commit to branch master
in repository gitlab.
commit 418b1b81b102b346675be4731993dd1ba75fb7f7
Author: Praveen Arimbrathodiyil <praveen at debian.org>
Date: Wed Feb 15 11:09:50 2017 +0530
Patch by Benjamin Drung
Use 'set -e' to let the script fail when any command fails. This allows
us to remove the "command || exit 1" constructs.
---
debian/grantpriv.sh | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/debian/grantpriv.sh b/debian/grantpriv.sh
index 848fe3c..354a44c 100755
--- a/debian/grantpriv.sh
+++ b/debian/grantpriv.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+set -e
dbname=gitlab_production
@@ -10,23 +11,15 @@ test -n "${gitlab_user:-}" || gitlab_user="gitlab"
if ! su ${gitlab_user} -c 'psql gitlab_production -c ""'
then
echo "Create ${gitlab_user} user with create database privillege..."
- su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\"" || {
- exit 1
- }
+ su postgres -c "psql -c \"CREATE USER ${gitlab_user} CREATEDB;\""
fi
# By default the gitlab_prodcution is not owned by gitlab user
echo "Make ${gitlab_user} user owner of $dbname database..."
-su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to ${gitlab_user};\"" || {
- exit 1
- }
+su postgres -c "psql -c \"ALTER DATABASE $dbname OWNER to ${gitlab_user};\""
echo "Grant all privileges to ${gitlab_user} user..."
-su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to ${gitlab_user};\"" || {
- exit 1
- }
+su postgres -c "psql -c \"GRANT ALL PRIVILEGES ON DATABASE template1 to ${gitlab_user};\""
# enable the pg_trgm extension
-su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\"" || {
- exit 1
- }
+su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\""
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/gitlab.git
More information about the Pkg-ruby-extras-commits
mailing list