Commit b823efe82a8c79f9b12804ce7c9084e3b3d7da08
1 parent
5dccf243
Exists in
master
and in
79 other branches
gitlab: update from contents in OBS
Showing
1 changed file
with
16 additions
and
6 deletions
Show diff stats
gitlab/gitlab.spec
| 1 | Name: gitlab | 1 | Name: gitlab |
| 2 | Version: 7.6.2 | 2 | Version: 7.6.2 |
| 3 | -Release: 9%{?dist} | 3 | +Release: 12%{?dist} |
| 4 | Summary: Software Development Platform | 4 | Summary: Software Development Platform |
| 5 | Group: Development/Tools | 5 | Group: Development/Tools |
| 6 | License: Expat | 6 | License: Expat |
| @@ -89,6 +89,7 @@ sed -i 's/\/home\/\git/\/usr\/lib/' %{buildroot}/etc/gitlab/unicorn.rb | @@ -89,6 +89,7 @@ sed -i 's/\/home\/\git/\/usr\/lib/' %{buildroot}/etc/gitlab/unicorn.rb | ||
| 89 | 89 | ||
| 90 | mkdir -p %{buildroot}/usr/lib/gitlab | 90 | mkdir -p %{buildroot}/usr/lib/gitlab |
| 91 | cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/ | 91 | cp -r app bin config config.ru db doc GITLAB_SHELL_VERSION lib Procfile public Rakefile vendor VERSION %{buildroot}/usr/lib/gitlab/ |
| 92 | +rm -rf %{buildroot}/usr/lib/gitlab/public/uploads | ||
| 92 | mv %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb.example %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb | 93 | mv %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb.example %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb |
| 93 | for configfile in gitlab.yml unicorn.rb database.yml; do | 94 | for configfile in gitlab.yml unicorn.rb database.yml; do |
| 94 | ln -s /etc/gitlab/$configfile %{buildroot}/usr/lib/gitlab/config | 95 | ln -s /etc/gitlab/$configfile %{buildroot}/usr/lib/gitlab/config |
| @@ -97,20 +98,22 @@ ln -s /var/log/gitlab %{buildroot}/usr/lib/gitlab/log | @@ -97,20 +98,22 @@ ln -s /var/log/gitlab %{buildroot}/usr/lib/gitlab/log | ||
| 97 | ln -s /var/lib/gitlab/tmp %{buildroot}/usr/lib/gitlab/tmp | 98 | ln -s /var/lib/gitlab/tmp %{buildroot}/usr/lib/gitlab/tmp |
| 98 | ln -s /var/lib/gitlab/.secret %{buildroot}/usr/lib/gitlab/.secret | 99 | ln -s /var/lib/gitlab/.secret %{buildroot}/usr/lib/gitlab/.secret |
| 99 | ln -s /var/lib/gitlab-assets %{buildroot}/usr/lib/gitlab/public/assets | 100 | ln -s /var/lib/gitlab-assets %{buildroot}/usr/lib/gitlab/public/assets |
| 100 | -ln -s /var/lib/gitlab-uploads %{buildroot}/usr/lib/gitlab/public/uploads | 101 | +ln -s /var/lib/gitlab/uploads %{buildroot}/usr/lib/gitlab/public/uploads |
| 101 | 102 | ||
| 102 | %post | 103 | %post |
| 104 | + | ||
| 103 | if [ -x /usr/bin/postgres ]; then | 105 | if [ -x /usr/bin/postgres ]; then |
| 104 | service postgresql initdb || true | 106 | service postgresql initdb || true |
| 105 | service postgresql start | 107 | service postgresql start |
| 106 | sudo -u postgres createuser --createdb git || true | 108 | sudo -u postgres createuser --createdb git || true |
| 107 | fi | 109 | fi |
| 110 | + | ||
| 108 | mkdir -p /var/log/gitlab | 111 | mkdir -p /var/log/gitlab |
| 109 | chown -R git:git /var/log/gitlab | 112 | chown -R git:git /var/log/gitlab |
| 110 | mkdir -p /var/lib/gitlab/backups | 113 | mkdir -p /var/lib/gitlab/backups |
| 111 | mkdir -p /var/lib/gitlab/satellites | 114 | mkdir -p /var/lib/gitlab/satellites |
| 112 | mkdir -p /var/lib/gitlab/tmp | 115 | mkdir -p /var/lib/gitlab/tmp |
| 113 | -mkdir -p /var/lib/gitlab-uploads | 116 | +mkdir -p /var/lib/gitlab/uploads |
| 114 | touch /var/lib/gitlab/.gitconfig | 117 | touch /var/lib/gitlab/.gitconfig |
| 115 | ln -s /var/lib/gitlab/.gitconfig /usr/lib/gitlab/.gitconfig | 118 | ln -s /var/lib/gitlab/.gitconfig /usr/lib/gitlab/.gitconfig |
| 116 | chown -R git:git /var/lib/gitlab | 119 | chown -R git:git /var/lib/gitlab |
| @@ -127,7 +130,13 @@ sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input" | @@ -127,7 +130,13 @@ sudo -u git -H "/usr/bin/git" config --global core.autocrlf "input" | ||
| 127 | mkdir -p /var/lib/gitlab-assets | 130 | mkdir -p /var/lib/gitlab-assets |
| 128 | 131 | ||
| 129 | cd /usr/lib/gitlab/ | 132 | cd /usr/lib/gitlab/ |
| 130 | -yes yes | sudo -u git bundle exec rake gitlab:setup RAILS_ENV=production | 133 | + |
| 134 | +rc=`sudo -u git bundle exec rake db:migrate:status RAILS_ENV=production | wc -l` | ||
| 135 | + | ||
| 136 | +if [ $rc -le 1 ];then | ||
| 137 | + yes yes | sudo -u git bundle exec rake gitlab:setup RAILS_ENV=production | ||
| 138 | +fi | ||
| 139 | + | ||
| 131 | bundle exec rake assets:precompile RAILS_ENV=production | 140 | bundle exec rake assets:precompile RAILS_ENV=production |
| 132 | 141 | ||
| 133 | cp /usr/lib/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab | 142 | cp /usr/lib/gitlab/lib/support/init.d/gitlab /etc/init.d/gitlab |
| @@ -137,8 +146,9 @@ cp /usr/lib/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab | @@ -137,8 +146,9 @@ cp /usr/lib/gitlab/lib/support/logrotate/gitlab /etc/logrotate.d/gitlab | ||
| 137 | sed -i 's/app_root="\/home\/\$app_user\/gitlab"/app_root="\/usr\/lib\/gitlab"/' /etc/default/gitlab | 146 | sed -i 's/app_root="\/home\/\$app_user\/gitlab"/app_root="\/usr\/lib\/gitlab"/' /etc/default/gitlab |
| 138 | sed -i 's/\/home\/\git/\/usr\/lib/' /etc/logrotate.d/gitlab | 147 | sed -i 's/\/home\/\git/\/usr\/lib/' /etc/logrotate.d/gitlab |
| 139 | 148 | ||
| 140 | -%postun | ||
| 141 | -service gitlab stop | 149 | +%preun |
| 150 | +systemctl stop gitlab | ||
| 151 | +systemctl disable gitlab | ||
| 142 | 152 | ||
| 143 | %files | 153 | %files |
| 144 | /usr/lib/gitlab | 154 | /usr/lib/gitlab |