Commit c3f3f67e0b73f363c1d5b2432288d6abce411833

Authored by Alexandre Barbosa
1 parent 9a7842e1

Copying files to /usr/lib/gitlab

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Lucas Kanashiro <kanashiro.duarte@gmail.com>
Showing 1 changed file with 32 additions and 2 deletions   Show diff stats
gitlab.spec
... ... @@ -7,8 +7,8 @@ License: Expat
7 7 URL: https://beta.softwarepublico.gov.br/gitlab/softwarepublico/gitlab
8 8 Source0: %{name}-%{version}.tar.gz
9 9  
10   -BuildRequires: gitlab-deps
11   -Requires: gitlab-deps
  10 +BuildRequires: gitlab-deps,postgresql-server, postgresql-devel
  11 +Requires: gitlab-deps, postgresql-server
12 12  
13 13 %description
14 14 GitLab
... ... @@ -16,13 +16,43 @@ GitLab
16 16 %prep
17 17 %autosetup
18 18  
  19 +%pre
  20 +adduser git
  21 +service postgresql initdb
  22 +service postgresql start
  23 +sudo -u postgres psql -d template1 << EOF
  24 +CREATE USER git CREATEDB;
  25 +CREATE DATABASE gitlabhq_production OWNER git;
  26 +\q
  27 +EOF
  28 +
19 29 %build
20 30 # make %{?_smp_mflags}
21 31  
22 32 %install
  33 +cp config/gitlab.yml.example config/gitlab.yml
  34 +cp config/unicorn.rb.example config/unicorn.rb
  35 +cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb
  36 +cp config/database.yml.postgresql config/database.yml
  37 +
23 38 mkdir -p %{buildroot}/usr/lib/gitlab
24 39 cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/
25 40  
  41 +%post
  42 +
  43 +cd /usr/lib/gitlab/
  44 +cp vendor/Gemfile* .
  45 +bundle exec rake gitlab:setup RAILS_ENV=production
  46 +
  47 +%postun
  48 +userdel git
  49 +
  50 +sudo -u postgres psql -d template1 << EOF
  51 +DROP DATABASE gitlabhq_production;
  52 +DROP USER git;
  53 +\q
  54 +EOF
  55 +
26 56 %files
27 57 /usr/lib/gitlab
28 58 %doc
... ...