Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gitlab
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian Ruby Team
gitlab
Commits
f7ca08b5
Commit
f7ca08b5
authored
9 years ago
by
Praveen Arimbrathodiyil
Browse files
Options
Downloads
Patches
Plain Diff
use postgres commands to create database
parent
264985b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
debian/config
+1
-4
1 addition, 4 deletions
debian/config
debian/grantpriv.sh
+24
-0
24 additions, 0 deletions
debian/grantpriv.sh
debian/install
+1
-0
1 addition, 0 deletions
debian/install
debian/postinst
+6
-1
6 additions, 1 deletion
debian/postinst
with
32 additions
and
5 deletions
debian/config
+
1
−
4
View file @
f7ca08b5
...
...
@@ -3,9 +3,6 @@
set
-e
echo
"Call debconf to configure gitlab"
# source debconf stuffs
.
/usr/share/debconf/confmodule
# DB password can be left blank
db_input high gitlab/dbpass
||
true
db_go
||
true
This diff is collapsed.
Click to expand it.
debian/grantpriv.sh
0 → 100755
+
24
−
0
View file @
f7ca08b5
#!/bin/sh
user
=
gitlab
dbname
=
gitlab_production
if
su gitlab
-c
'psql gitlab_production -c ""'
then
echo
"Create
$user
user with create database privillege..."
sudo
-u
postgres psql
-c
"CREATE USER
$user
CREATEDB;"
||
{
exit
1
}
fi
echo
"Make
$user
user owner of
$dbname
database..."
sudo
-u
postgres psql
-c
"ALTER DATABASE
$dbname
OWNER to
$user
;"
||
{
exit
1
}
echo
"Grant all privileges to
$user
user..."
sudo
-u
postgres psql
-c
"GRANT ALL PRIVILEGES ON DATABASE template1 to
$user
;"
||
{
exit
1
}
This diff is collapsed.
Click to expand it.
debian/install
+
1
−
0
View file @
f7ca08b5
...
...
@@ -2,6 +2,7 @@ debian/database.yml etc/gitlab
debian/gitlab.yml etc/gitlab
debian/gitlab-debian.conf etc/gitlab
debian/adduser.sh usr/lib/gitlab/scripts
debian/grantpriv.sh usr/lib/gitlab/scripts
debian/rake-tasks.sh usr/lib/gitlab/scripts
app usr/share/gitlab
bin usr/share/gitlab
...
...
This diff is collapsed.
Click to expand it.
debian/postinst
+
6
−
1
View file @
f7ca08b5
...
...
@@ -32,10 +32,15 @@ case "$1" in
.
/usr/lib/gitlab/scripts/adduser.sh
chown
-R
${
gitlab_user
}
:
${
gitlab_home
}
cd
${
gitlab_home
}
# Show debconf questions
.
/usr/share/debconf/confmodule
echo
"Create database if not present"
if
!
su gitlab
-s
/bin/sh
-c
"psql gitlab_production -c ''"
then
su postgres
-c
'createdb gitlab_production'
fi
.
/usr/lib/gitlab/scripts/grantpriv.sh
echo
"Setting up environment varibales..."
export
RAILS_ENV
=
production
export
DB
=
postgres
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment