Commit 001a3c05bed0c5d5b5450ab5e7005cd64e10b5d6
1 parent
b896fe57
Exists in
master
and in
79 other branches
Structure for multiple OBS projects
Showing
5 changed files
with
236 additions
and
236 deletions
Show diff stats
Makefile
| 1 | +packages = $(shell basename --suffix=.spec specs/*/*.spec) | |
| 2 | + | |
| 1 | 3 | all: |
| 2 | 4 | @echo "Usage:" |
| 3 | 5 | @echo |
| 4 | - @echo 'make gitlab # uploads gitlab.spec to obs' | |
| 5 | - @echo 'make gitlab-shell # uploads gitlab-shell.spec to obs' | |
| 6 | - | |
| 7 | -gitlab gitlab-shell: | |
| 8 | - $(MAKE) upload PACKAGE=$@ | |
| 6 | + @for pkg in $(packages); do printf 'make %-20s # uploads %s.spec to obs\n' $$pkg $$pkg; done | |
| 9 | 7 | |
| 10 | -obs_project = isv:spb:gitlab | |
| 8 | +$(packages): | |
| 9 | + @spec=$$(find specs/ -name $@.spec); \ | |
| 10 | + project=isb:spb:$$(basename $$(dirname $$spec)); \ | |
| 11 | + $(MAKE) upload package=$@ spec=$$spec project=$$project | |
| 11 | 12 | |
| 12 | 13 | upload: |
| 13 | - test -n "$(PACKAGE)" | |
| 14 | 14 | mkdir -p obs |
| 15 | - if test -d obs/$(obs_project)/$(PACKAGE); then (cd obs/$(obs_project)/$(PACKAGE) && osc update); else (cd obs && osc checkout $(obs_project) $(PACKAGE)); fi | |
| 16 | - cp $(PACKAGE).spec obs/isv:spb:gitlab/$(PACKAGE)/ | |
| 17 | - cd obs/isv:spb:gitlab/$(PACKAGE) && osc commit -m 'Update $(PACKAGE)' | |
| 15 | + if test -d obs/$(project)/$(package); then (cd obs/$(project)/$(package) && osc update); else (cd obs && osc checkout $(project) $(PACKAGE)); fi | |
| 16 | + cp $(spec) obs/$(project)/$(package)/ | |
| 17 | + cd obs/$(project)/$(PACKAGE) && osc commit -m 'Update $(package)' | ... | ... |
gitlab-shell.spec
| ... | ... | @@ -1,83 +0,0 @@ |
| 1 | -Name: gitlab-shell | |
| 2 | -Version: 2.4.0 | |
| 3 | -Release: 2%{?dist} | |
| 4 | -Summary: Software Development Platform | |
| 5 | - | |
| 6 | -Group: Development/Tools | |
| 7 | -License: Expat | |
| 8 | -URL: https://gitlab.com/gitlab-org/gitlab-shell | |
| 9 | -Source0: %{name}-%{version}.tar.gz | |
| 10 | -BuildArch: noarch | |
| 11 | - | |
| 12 | -# BuildRequires: | |
| 13 | -Requires: ruby >= 1.9, redis | |
| 14 | - | |
| 15 | -%description | |
| 16 | -Gitlab-shell | |
| 17 | - | |
| 18 | -%prep | |
| 19 | -%setup -q | |
| 20 | - | |
| 21 | -%build | |
| 22 | -cat > config.yml <<EOF | |
| 23 | -user: git | |
| 24 | -gitlab_url: "http://localhost:8080/" | |
| 25 | - | |
| 26 | -http_settings: | |
| 27 | -# user: someone | |
| 28 | -# password: somepass | |
| 29 | -# ca_file: /etc/ssl/cert.pem | |
| 30 | -# ca_path: /etc/pki/tls/certs | |
| 31 | - self_signed_cert: false | |
| 32 | - | |
| 33 | -repos_path: "/var/lib/gitlab/repositories/" | |
| 34 | -auth_file: "/var/lib/gitlab-shell/.ssh/authorized_keys" | |
| 35 | - | |
| 36 | -redis: | |
| 37 | - bin: /usr/bin/redis-cli | |
| 38 | - host: 127.0.0.1 | |
| 39 | - port: 6379 | |
| 40 | - # pass: redispass # Allows you to specify the password for Redis | |
| 41 | - #database: 0 | |
| 42 | - #socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP | |
| 43 | - #namespace: resque:gitlab | |
| 44 | - | |
| 45 | -log_file: "/var/log/gitlab-shell/gitlab-shell.log" | |
| 46 | -log_level: INFO | |
| 47 | -audit_usernames: false | |
| 48 | -EOF | |
| 49 | - | |
| 50 | -%install | |
| 51 | -mkdir -p %{buildroot}/usr/lib/gitlab-shell | |
| 52 | -mkdir -p %{buildroot}/etc/gitlab-shell | |
| 53 | - | |
| 54 | -mv config.yml %{buildroot}/etc/gitlab-shell | |
| 55 | -ln -s /etc/gitlab-shell/config.yml %{buildroot}/usr/lib/gitlab-shell/ | |
| 56 | - | |
| 57 | -cp -r . %{buildroot}/usr/lib/gitlab-shell | |
| 58 | - | |
| 59 | -%post | |
| 60 | -groupadd git || true | |
| 61 | -if ! id git; then | |
| 62 | - adduser --system --home-dir /usr/lib/gitlab --no-create-home --gid git git | |
| 63 | -fi | |
| 64 | - | |
| 65 | -mkdir -p /var/log/gitlab-shell | |
| 66 | -mkdir -p /var/lib/gitlab-shell/.ssh | |
| 67 | - | |
| 68 | -ln -s /var/lib/gitlab-shell/.ssh /usr/lib/gitlab/.ssh | |
| 69 | - | |
| 70 | -chown -R git:git /var/log/gitlab-shell | |
| 71 | -chown -R git:git /var/lib/gitlab-shell | |
| 72 | - | |
| 73 | -ln -s /var/lib/gitlab/.gitlab_shell_secret /usr/lib/gitlab-shell/.gitlab_shell_secret | |
| 74 | - | |
| 75 | -sudo -u git -H /usr/lib/gitlab-shell/bin/install | |
| 76 | - | |
| 77 | -%files | |
| 78 | -/usr/lib/gitlab-shell | |
| 79 | -/etc/gitlab-shell | |
| 80 | - | |
| 81 | - | |
| 82 | -%changelog | |
| 83 | - |
gitlab.spec
| ... | ... | @@ -1,143 +0,0 @@ |
| 1 | -Name: gitlab | |
| 2 | -Version: 7.6.2 | |
| 3 | -Release: 4%{?dist} | |
| 4 | -Summary: Software Development Platform | |
| 5 | -Group: Development/Tools | |
| 6 | -License: Expat | |
| 7 | -URL: https://beta.softwarepublico.gov.br/gitlab/softwarepublico/gitlab | |
| 8 | -Source0: %{name}-%{version}.tar.gz | |
| 9 | -BuildArch: noarch | |
| 10 | -BuildRequires: gitlab-deps | |
| 11 | -Requires: gitlab-deps, gitlab-shell, git | |
| 12 | - | |
| 13 | -%description | |
| 14 | -GitLab | |
| 15 | - | |
| 16 | -%prep | |
| 17 | -%setup -q | |
| 18 | -#%patch0 -p 1 | |
| 19 | - | |
| 20 | -%build | |
| 21 | -cat > config/gitlab.yml <<EOF | |
| 22 | -production: &base | |
| 23 | - gitlab: | |
| 24 | - host: localhost | |
| 25 | - port: 80 # Set to 443 if using HTTPS | |
| 26 | - https: false # Set to true if using HTTPS | |
| 27 | - email_from: example@example.com | |
| 28 | - default_projects_limit: 10 | |
| 29 | - default_projects_features: | |
| 30 | - issues: true | |
| 31 | - merge_requests: true | |
| 32 | - wiki: true | |
| 33 | - snippets: false | |
| 34 | - visibility_level: "private" # can be "private" | "internal" | "public" | |
| 35 | - gravatar: | |
| 36 | - enabled: true | |
| 37 | - plain_url: "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon" | |
| 38 | - ssl_url: "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon" | |
| 39 | - omniauth: | |
| 40 | - # Allow login via Twitter, Google, etc. using OmniAuth providers | |
| 41 | - enabled: false | |
| 42 | - allow_single_sign_on: false | |
| 43 | - block_auto_created_users: true | |
| 44 | - providers: | |
| 45 | - # - { name: 'google_oauth2', app_id: 'YOUR APP ID', | |
| 46 | - # app_secret: 'YOUR APP SECRET', | |
| 47 | - # args: { access_type: 'offline', approval_prompt: '' } } | |
| 48 | - satellites: | |
| 49 | - path: /var/lib/gitlab/satellites | |
| 50 | - timeout: 30 | |
| 51 | - backup: | |
| 52 | - path: /var/lib/gitlab/backups | |
| 53 | - gitlab_shell: | |
| 54 | - path: /usr/lib/gitlab-shell | |
| 55 | - repos_path: /var/lib/gitlab/repositories/ | |
| 56 | - hooks_path: /usr/lib/gitlab-shell/hooks/ | |
| 57 | - # Git over HTTP | |
| 58 | - upload_pack: true | |
| 59 | - receive_pack: true | |
| 60 | - git: | |
| 61 | - bin_path: /usr/bin/git | |
| 62 | - max_size: 20971520 # 20.megabytes | |
| 63 | - timeout: 10 | |
| 64 | - extra: | |
| 65 | - ## Piwik analytics. | |
| 66 | - # piwik_url: '_your_piwik_url' | |
| 67 | - # piwik_site_id: '_your_piwik_site_id' | |
| 68 | - | |
| 69 | - ## Text under sign-in page (Markdown enabled) | |
| 70 | - # sign_in_text: | | |
| 71 | - #  | |
| 72 | - # [Learn more about CompanyName](http://www.companydomain.com/) | |
| 73 | -EOF | |
| 74 | - | |
| 75 | -%install | |
| 76 | -mkdir -p %{buildroot}/etc/gitlab | |
| 77 | -mv config/gitlab.yml %{buildroot}/etc/gitlab/gitlab.yml | |
| 78 | -cp config/unicorn.rb.example %{buildroot}/etc/gitlab/unicorn.rb | |
| 79 | -cp config/database.yml.postgresql %{buildroot}/etc/gitlab/database.yml | |
| 80 | - | |
| 81 | -sed -i 's/\/home\/\git/\/usr\/lib/' %{buildroot}/etc/gitlab/unicorn.rb | |
| 82 | - | |
| 83 | -mkdir -p %{buildroot}/usr/lib/gitlab | |
| 84 | -cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/ | |
| 85 | -mv %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb.example %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb | |
| 86 | -for configfile in gitlab.yml unicorn.rb database.yml; do | |
| 87 | - ln -s /etc/gitlab/$configfile %{buildroot}/usr/lib/gitlab/config | |
| 88 | -done | |
| 89 | -ln -s /var/log/gitlab %{buildroot}/usr/lib/gitlab/log | |
| 90 | -ln -s /var/lib/gitlab/tmp %{buildroot}/usr/lib/gitlab/tmp | |
| 91 | -ln -s /var/lib/gitlab/.gitlab_shell_secret %{buildroot}/usr/lib/gitlab/.gitlab_shell_secret | |
| 92 | -ln -s /var/lib/gitlab/.secret %{buildroot}/usr/lib/gitlab/.secret | |
| 93 | -ln -s /var/lib/gitlab-assets %{buildroot}/usr/lib/gitlab/public/assets | |
| 94 | - | |
| 95 | -%post | |
| 96 | -groupadd git || true | |
| 97 | -if ! id git; then | |
| 98 | - adduser --system --home-dir /usr/lib/gitlab --no-create-home --gid git git | |
| 99 | -fi | |
| 100 | -if [ -x /usr/bin/postgres ]; then | |
| 101 | - service postgresql initdb || true | |
| 102 | - service postgresql start | |
| 103 | - sudo -u postgres createuser --createdb git || true | |
| 104 | -fi | |
| 105 | -mkdir -p /var/log/gitlab | |
| 106 | -chown -R git:git /var/log/gitlab | |
| 107 | -mkdir -p /var/lib/gitlab/backups | |
| 108 | -mkdir -p /var/lib/gitlab/repositories | |
| 109 | -mkdir -p /var/lib/gitlab/satellites | |
| 110 | -mkdir -p /var/lib/gitlab/tmp | |
| 111 | -touch /var/lib/gitlab/.gitconfig | |
| 112 | -ln -s /var/lib/gitlab/.gitconfig /usr/lib/gitlab/.gitconfig | |
| 113 | -chown -R git:git /var/lib/gitlab | |
| 114 | -chmod u+rwx,g=rx,o-rwx /var/lib/gitlab/satellites | |
| 115 | - | |
| 116 | -if [ /usr/bin/redis-server ]; then | |
| 117 | - service redis start | |
| 118 | -fi | |
| 119 | - | |
| 120 | -sudo -u git -H "/usr/bin/git" config --global user.name "GitLab" | |
| 121 | -sudo -u git -H "/usr/bin/git" config --global user.email "example@example.com" | |
| 122 | -sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input" | |
| 123 | - | |
| 124 | -mkdir -p /var/lib/gitlab-assets | |
| 125 | - | |
| 126 | -cd /usr/lib/gitlab/ | |
| 127 | -yes yes | sudo -u git bundle exec rake gitlab:setup RAILS_ENV=production | |
| 128 | -bundle exec rake assets:precompile RAILS_ENV=production | |
| 129 | - | |
| 130 | -cp /usr/lib/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab | |
| 131 | -cp /usr/lib/gitlab/lib/support/init.d/gitlab.default.example /etc/default/gitlab | |
| 132 | -cp /usr/lib/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab | |
| 133 | - | |
| 134 | -sed -i 's/app_root="\/home\/\$app_user\/gitlab"/app_root="\/usr\/lib\/gitlab"/' /etc/default/gitlab | |
| 135 | -sed -i 's/\/home\/\git/\/usr\/lib/' /etc/logrotate.d/gitlab | |
| 136 | - | |
| 137 | -%postun | |
| 138 | -service gitlab stop | |
| 139 | - | |
| 140 | -%files | |
| 141 | -/usr/lib/gitlab | |
| 142 | -/etc/gitlab | |
| 143 | -%doc |
| ... | ... | @@ -0,0 +1,83 @@ |
| 1 | +Name: gitlab-shell | |
| 2 | +Version: 2.4.0 | |
| 3 | +Release: 2%{?dist} | |
| 4 | +Summary: Software Development Platform | |
| 5 | + | |
| 6 | +Group: Development/Tools | |
| 7 | +License: Expat | |
| 8 | +URL: https://gitlab.com/gitlab-org/gitlab-shell | |
| 9 | +Source0: %{name}-%{version}.tar.gz | |
| 10 | +BuildArch: noarch | |
| 11 | + | |
| 12 | +# BuildRequires: | |
| 13 | +Requires: ruby >= 1.9, redis | |
| 14 | + | |
| 15 | +%description | |
| 16 | +Gitlab-shell | |
| 17 | + | |
| 18 | +%prep | |
| 19 | +%setup -q | |
| 20 | + | |
| 21 | +%build | |
| 22 | +cat > config.yml <<EOF | |
| 23 | +user: git | |
| 24 | +gitlab_url: "http://localhost:8080/" | |
| 25 | + | |
| 26 | +http_settings: | |
| 27 | +# user: someone | |
| 28 | +# password: somepass | |
| 29 | +# ca_file: /etc/ssl/cert.pem | |
| 30 | +# ca_path: /etc/pki/tls/certs | |
| 31 | + self_signed_cert: false | |
| 32 | + | |
| 33 | +repos_path: "/var/lib/gitlab/repositories/" | |
| 34 | +auth_file: "/var/lib/gitlab-shell/.ssh/authorized_keys" | |
| 35 | + | |
| 36 | +redis: | |
| 37 | + bin: /usr/bin/redis-cli | |
| 38 | + host: 127.0.0.1 | |
| 39 | + port: 6379 | |
| 40 | + # pass: redispass # Allows you to specify the password for Redis | |
| 41 | + #database: 0 | |
| 42 | + #socket: /var/run/redis/redis.sock # Comment out this line if you want to use TCP | |
| 43 | + #namespace: resque:gitlab | |
| 44 | + | |
| 45 | +log_file: "/var/log/gitlab-shell/gitlab-shell.log" | |
| 46 | +log_level: INFO | |
| 47 | +audit_usernames: false | |
| 48 | +EOF | |
| 49 | + | |
| 50 | +%install | |
| 51 | +mkdir -p %{buildroot}/usr/lib/gitlab-shell | |
| 52 | +mkdir -p %{buildroot}/etc/gitlab-shell | |
| 53 | + | |
| 54 | +mv config.yml %{buildroot}/etc/gitlab-shell | |
| 55 | +ln -s /etc/gitlab-shell/config.yml %{buildroot}/usr/lib/gitlab-shell/ | |
| 56 | + | |
| 57 | +cp -r . %{buildroot}/usr/lib/gitlab-shell | |
| 58 | + | |
| 59 | +%post | |
| 60 | +groupadd git || true | |
| 61 | +if ! id git; then | |
| 62 | + adduser --system --home-dir /usr/lib/gitlab --no-create-home --gid git git | |
| 63 | +fi | |
| 64 | + | |
| 65 | +mkdir -p /var/log/gitlab-shell | |
| 66 | +mkdir -p /var/lib/gitlab-shell/.ssh | |
| 67 | + | |
| 68 | +ln -s /var/lib/gitlab-shell/.ssh /usr/lib/gitlab/.ssh | |
| 69 | + | |
| 70 | +chown -R git:git /var/log/gitlab-shell | |
| 71 | +chown -R git:git /var/lib/gitlab-shell | |
| 72 | + | |
| 73 | +ln -s /var/lib/gitlab/.gitlab_shell_secret /usr/lib/gitlab-shell/.gitlab_shell_secret | |
| 74 | + | |
| 75 | +sudo -u git -H /usr/lib/gitlab-shell/bin/install | |
| 76 | + | |
| 77 | +%files | |
| 78 | +/usr/lib/gitlab-shell | |
| 79 | +/etc/gitlab-shell | |
| 80 | + | |
| 81 | + | |
| 82 | +%changelog | |
| 83 | + | ... | ... |
| ... | ... | @@ -0,0 +1,143 @@ |
| 1 | +Name: gitlab | |
| 2 | +Version: 7.6.2 | |
| 3 | +Release: 4%{?dist} | |
| 4 | +Summary: Software Development Platform | |
| 5 | +Group: Development/Tools | |
| 6 | +License: Expat | |
| 7 | +URL: https://beta.softwarepublico.gov.br/gitlab/softwarepublico/gitlab | |
| 8 | +Source0: %{name}-%{version}.tar.gz | |
| 9 | +BuildArch: noarch | |
| 10 | +BuildRequires: gitlab-deps | |
| 11 | +Requires: gitlab-deps, gitlab-shell, git | |
| 12 | + | |
| 13 | +%description | |
| 14 | +GitLab | |
| 15 | + | |
| 16 | +%prep | |
| 17 | +%setup -q | |
| 18 | +#%patch0 -p 1 | |
| 19 | + | |
| 20 | +%build | |
| 21 | +cat > config/gitlab.yml <<EOF | |
| 22 | +production: &base | |
| 23 | + gitlab: | |
| 24 | + host: localhost | |
| 25 | + port: 80 # Set to 443 if using HTTPS | |
| 26 | + https: false # Set to true if using HTTPS | |
| 27 | + email_from: example@example.com | |
| 28 | + default_projects_limit: 10 | |
| 29 | + default_projects_features: | |
| 30 | + issues: true | |
| 31 | + merge_requests: true | |
| 32 | + wiki: true | |
| 33 | + snippets: false | |
| 34 | + visibility_level: "private" # can be "private" | "internal" | "public" | |
| 35 | + gravatar: | |
| 36 | + enabled: true | |
| 37 | + plain_url: "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon" | |
| 38 | + ssl_url: "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon" | |
| 39 | + omniauth: | |
| 40 | + # Allow login via Twitter, Google, etc. using OmniAuth providers | |
| 41 | + enabled: false | |
| 42 | + allow_single_sign_on: false | |
| 43 | + block_auto_created_users: true | |
| 44 | + providers: | |
| 45 | + # - { name: 'google_oauth2', app_id: 'YOUR APP ID', | |
| 46 | + # app_secret: 'YOUR APP SECRET', | |
| 47 | + # args: { access_type: 'offline', approval_prompt: '' } } | |
| 48 | + satellites: | |
| 49 | + path: /var/lib/gitlab/satellites | |
| 50 | + timeout: 30 | |
| 51 | + backup: | |
| 52 | + path: /var/lib/gitlab/backups | |
| 53 | + gitlab_shell: | |
| 54 | + path: /usr/lib/gitlab-shell | |
| 55 | + repos_path: /var/lib/gitlab/repositories/ | |
| 56 | + hooks_path: /usr/lib/gitlab-shell/hooks/ | |
| 57 | + # Git over HTTP | |
| 58 | + upload_pack: true | |
| 59 | + receive_pack: true | |
| 60 | + git: | |
| 61 | + bin_path: /usr/bin/git | |
| 62 | + max_size: 20971520 # 20.megabytes | |
| 63 | + timeout: 10 | |
| 64 | + extra: | |
| 65 | + ## Piwik analytics. | |
| 66 | + # piwik_url: '_your_piwik_url' | |
| 67 | + # piwik_site_id: '_your_piwik_site_id' | |
| 68 | + | |
| 69 | + ## Text under sign-in page (Markdown enabled) | |
| 70 | + # sign_in_text: | | |
| 71 | + #  | |
| 72 | + # [Learn more about CompanyName](http://www.companydomain.com/) | |
| 73 | +EOF | |
| 74 | + | |
| 75 | +%install | |
| 76 | +mkdir -p %{buildroot}/etc/gitlab | |
| 77 | +mv config/gitlab.yml %{buildroot}/etc/gitlab/gitlab.yml | |
| 78 | +cp config/unicorn.rb.example %{buildroot}/etc/gitlab/unicorn.rb | |
| 79 | +cp config/database.yml.postgresql %{buildroot}/etc/gitlab/database.yml | |
| 80 | + | |
| 81 | +sed -i 's/\/home\/\git/\/usr\/lib/' %{buildroot}/etc/gitlab/unicorn.rb | |
| 82 | + | |
| 83 | +mkdir -p %{buildroot}/usr/lib/gitlab | |
| 84 | +cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/ | |
| 85 | +mv %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb.example %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb | |
| 86 | +for configfile in gitlab.yml unicorn.rb database.yml; do | |
| 87 | + ln -s /etc/gitlab/$configfile %{buildroot}/usr/lib/gitlab/config | |
| 88 | +done | |
| 89 | +ln -s /var/log/gitlab %{buildroot}/usr/lib/gitlab/log | |
| 90 | +ln -s /var/lib/gitlab/tmp %{buildroot}/usr/lib/gitlab/tmp | |
| 91 | +ln -s /var/lib/gitlab/.gitlab_shell_secret %{buildroot}/usr/lib/gitlab/.gitlab_shell_secret | |
| 92 | +ln -s /var/lib/gitlab/.secret %{buildroot}/usr/lib/gitlab/.secret | |
| 93 | +ln -s /var/lib/gitlab-assets %{buildroot}/usr/lib/gitlab/public/assets | |
| 94 | + | |
| 95 | +%post | |
| 96 | +groupadd git || true | |
| 97 | +if ! id git; then | |
| 98 | + adduser --system --home-dir /usr/lib/gitlab --no-create-home --gid git git | |
| 99 | +fi | |
| 100 | +if [ -x /usr/bin/postgres ]; then | |
| 101 | + service postgresql initdb || true | |
| 102 | + service postgresql start | |
| 103 | + sudo -u postgres createuser --createdb git || true | |
| 104 | +fi | |
| 105 | +mkdir -p /var/log/gitlab | |
| 106 | +chown -R git:git /var/log/gitlab | |
| 107 | +mkdir -p /var/lib/gitlab/backups | |
| 108 | +mkdir -p /var/lib/gitlab/repositories | |
| 109 | +mkdir -p /var/lib/gitlab/satellites | |
| 110 | +mkdir -p /var/lib/gitlab/tmp | |
| 111 | +touch /var/lib/gitlab/.gitconfig | |
| 112 | +ln -s /var/lib/gitlab/.gitconfig /usr/lib/gitlab/.gitconfig | |
| 113 | +chown -R git:git /var/lib/gitlab | |
| 114 | +chmod u+rwx,g=rx,o-rwx /var/lib/gitlab/satellites | |
| 115 | + | |
| 116 | +if [ /usr/bin/redis-server ]; then | |
| 117 | + service redis start | |
| 118 | +fi | |
| 119 | + | |
| 120 | +sudo -u git -H "/usr/bin/git" config --global user.name "GitLab" | |
| 121 | +sudo -u git -H "/usr/bin/git" config --global user.email "example@example.com" | |
| 122 | +sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input" | |
| 123 | + | |
| 124 | +mkdir -p /var/lib/gitlab-assets | |
| 125 | + | |
| 126 | +cd /usr/lib/gitlab/ | |
| 127 | +yes yes | sudo -u git bundle exec rake gitlab:setup RAILS_ENV=production | |
| 128 | +bundle exec rake assets:precompile RAILS_ENV=production | |
| 129 | + | |
| 130 | +cp /usr/lib/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab | |
| 131 | +cp /usr/lib/gitlab/lib/support/init.d/gitlab.default.example /etc/default/gitlab | |
| 132 | +cp /usr/lib/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab | |
| 133 | + | |
| 134 | +sed -i 's/app_root="\/home\/\$app_user\/gitlab"/app_root="\/usr\/lib\/gitlab"/' /etc/default/gitlab | |
| 135 | +sed -i 's/\/home\/\git/\/usr\/lib/' /etc/logrotate.d/gitlab | |
| 136 | + | |
| 137 | +%postun | |
| 138 | +service gitlab stop | |
| 139 | + | |
| 140 | +%files | |
| 141 | +/usr/lib/gitlab | |
| 142 | +/etc/gitlab | |
| 143 | +%doc | ... | ... |