Commit c3f3f67e0b73f363c1d5b2432288d6abce411833

Authored by Alexandre Barbosa
1 parent 9a7842e1
Exists in master and in 79 other branches add_sisp_to_chef, add_super_archives_plugin, api_for_colab, automates_core_packing, backup_not_prod, changes_in_buttons_on_content_panel, colab_automated_login, colab_spb_plugin_recipe, colab_widgets_settings, design_validation, dev_env_minimal, disable_email_dev, fix_breadcrumbs_position, fix_categories_software_link, fix_edit_institution, fix_edit_software_with_another_license, fix_get_license_info, fix_gitlab_assets_permission, fix_list_style_inside_article, fix_list_style_on_folder_elements, fix_members_pagination, fix_merge_request_url, fix_models_translations, fix_no_license, fix_software_api, fix_software_block_migration, fix_software_communities_translations, fix_software_communities_unit_test, fix_style_create_institution_admin_panel, fix_superarchives_imports, fix_sym_links_noosfero, focus_search_field_theme, gov-user-refactoring, gov-user-refactoring-rails4, header_fix, institution_modal_on_rating, kalibro-conf-refactoring, kalibro-processor-package, lxc_settings, margin_fix, mezuro_cookbook, prezento, refactor_download_block, refactor_software_communities, refactor_software_for_sisp, register_page, release-process, release-process-v2, remove-unused-images, remove_broken_theme, remove_secondary_email_from_user, remove_sisp_buttons, removing_super_archives_email, review_message, scope2method, signals_user_noosfero, sisp_catalog_header, sisp_colab_config, sisp_dev, sisp_dev_master, sisp_simple_version, software_as_organization, software_catalog_style_fix, software_communities_html_refactor, software_infos_api, spb_minimal_env, spb_to_rails4, spec_refactor, stable-4.1, stable-4.2, stable-4.x, temp_soft_comm_refactoring, theme_header, theme_javascript_refactory, thread_dropdown, thread_page, update_search_by_categories, update_software_api, update_softwares_boxes

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
... ...