Commit 93f3ea07cdf2223db806cd50e097da2c41560404
1 parent
85dfbd37
Exists in
master
and in
90 other branches
Create gitlab database
Showing
4 changed files
with
22 additions
and
0 deletions
Show diff stats
config/roles/database_server.rb
... | ... | @@ -0,0 +1,16 @@ |
1 | +execute 'createuser:gitlab' do | |
2 | + command 'createuser gitlab' | |
3 | + user 'postgres' | |
4 | + only_if do | |
5 | + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(*) from pg_user where usename = 'gitlab';"`.strip.to_i == 0 | |
6 | + end | |
7 | +end | |
8 | + | |
9 | +execute 'createdb:gitlab' do | |
10 | + command 'createdb --owner=gitlab gitlab' | |
11 | + user 'postgres' | |
12 | + only_if do | |
13 | + `sudo -u postgres -i psql --quiet --tuples-only -c "select count(1) from pg_database where datname = 'gitlab';"`.strip.to_i == 0 | |
14 | + end | |
15 | +end | |
16 | + | ... | ... |
cookbooks/postgresql/templates/centos/pg_hba.conf.erb
test/postgresql_test.sh
... | ... | @@ -8,5 +8,9 @@ test_colab_database_created() { |
8 | 8 | assertTrue 'colab database created in PostgreSQL' 'run_on database sudo -u postgres -i psql colab < /dev/null' |
9 | 9 | } |
10 | 10 | |
11 | +test_gitlab_database_created() { | |
12 | + assertTrue 'gitlab database created in PostgreSQL' 'run_on database sudo -u postgres -i psql gitlab < /dev/null' | |
13 | +} | |
14 | + | |
11 | 15 | . shunit2 |
12 | 16 | ... | ... |