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 | 1 | Name: gitlab |
2 | 2 | Version: 7.6.2 |
3 | -Release: 9%{?dist} | |
3 | +Release: 12%{?dist} | |
4 | 4 | Summary: Software Development Platform |
5 | 5 | Group: Development/Tools |
6 | 6 | License: Expat |
... | ... | @@ -89,6 +89,7 @@ sed -i 's/\/home\/\git/\/usr\/lib/' %{buildroot}/etc/gitlab/unicorn.rb |
89 | 89 | |
90 | 90 | mkdir -p %{buildroot}/usr/lib/gitlab |
91 | 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 | 93 | mv %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb.example %{buildroot}/usr/lib/gitlab/config/initializers/rack_attack.rb |
93 | 94 | for configfile in gitlab.yml unicorn.rb database.yml; do |
94 | 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 | 98 | ln -s /var/lib/gitlab/tmp %{buildroot}/usr/lib/gitlab/tmp |
98 | 99 | ln -s /var/lib/gitlab/.secret %{buildroot}/usr/lib/gitlab/.secret |
99 | 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 | 103 | %post |
104 | + | |
103 | 105 | if [ -x /usr/bin/postgres ]; then |
104 | 106 | service postgresql initdb || true |
105 | 107 | service postgresql start |
106 | 108 | sudo -u postgres createuser --createdb git || true |
107 | 109 | fi |
110 | + | |
108 | 111 | mkdir -p /var/log/gitlab |
109 | 112 | chown -R git:git /var/log/gitlab |
110 | 113 | mkdir -p /var/lib/gitlab/backups |
111 | 114 | mkdir -p /var/lib/gitlab/satellites |
112 | 115 | mkdir -p /var/lib/gitlab/tmp |
113 | -mkdir -p /var/lib/gitlab-uploads | |
116 | +mkdir -p /var/lib/gitlab/uploads | |
114 | 117 | touch /var/lib/gitlab/.gitconfig |
115 | 118 | ln -s /var/lib/gitlab/.gitconfig /usr/lib/gitlab/.gitconfig |
116 | 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 | 130 | mkdir -p /var/lib/gitlab-assets |
128 | 131 | |
129 | 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 | 140 | bundle exec rake assets:precompile RAILS_ENV=production |
132 | 141 | |
133 | 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 | 146 | sed -i 's/app_root="\/home\/\$app_user\/gitlab"/app_root="\/usr\/lib\/gitlab"/' /etc/default/gitlab |
138 | 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 | 153 | %files |
144 | 154 | /usr/lib/gitlab | ... | ... |