[packages/gitlab-ce] new, version 8.1.4
glen
glen at pld-linux.org
Tue Feb 23 18:32:27 CET 2016
commit edff9e1382a1a93a893fc3861a73d1c30db7d7de
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Feb 23 19:27:10 2016 +0200
new, version 8.1.4
adopted from openmamba src.rpm
https://www.openmamba.org/pub/openmamba/devel/SRPMS.base/gitlab-ce-8.1.4-1mamba.src.rpm
gitlab-apache-conf | 44 +++++++++++
gitlab-ce.spec | 201 +++++++++++++++++++++++++++++++++++++++++++++++++
gitlab-sidekiq.service | 24 ++++++
gitlab-unicorn.service | 24 ++++++
gitlab.logrotate | 21 ++++++
gitlab.target | 15 ++++
gitlab.tmpfiles.d | 1 +
7 files changed, 330 insertions(+)
---
diff --git a/gitlab-ce.spec b/gitlab-ce.spec
new file mode 100644
index 0000000..c2f2b01
--- /dev/null
+++ b/gitlab-ce.spec
@@ -0,0 +1,201 @@
+Summary: A Web interface to create projects and repositories, manage access and do code reviews
+Name: gitlab-ce
+Version: 8.1.4
+Release: 0.1
+License: MIT
+Group: Applications/WWW
+Source0: https://gitlab.com/gitlab-org/gitlab-ce.git/v%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 742f0752299c6b7aefe332bc61658426
+URL: https://www.gitlab.com/gitlab-ce/
+Source1: gitlab.target
+Source2: gitlab-sidekiq.service
+Source3: gitlab-unicorn.service
+Source4: gitlab.logrotate
+Source5: gitlab.tmpfiles.d
+Source6: gitlab-apache-conf
+BuildRequires: ruby-bundler
+Obsoletes: gitlab <= 8.1.4
+Requires(pre): gitlab-shell
+Requires: apache-base
+Requires: git-core
+Requires: mysql
+Requires: redis-server
+Requires: ruby-bundler
+BuildArch: noarch
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%define gitlab_uid 65434
+%define gitlab_gid 65434
+
+%define homedir %{_localstatedir}/lib/gitlab
+
+%description
+GitLab Community Edition (CE) is open source software to collaborate
+on code. Create projects and repositories, manage access and do code
+reviews. GitLab CE is on-premises software that you can install and
+use on your server(s).
+
+%prep
+%setup -q
+
+# Patching config files:
+sed -e "s|# user: git|user: gitlab|" \
+ -e "s|/home/git/repositories|%{homedir}/repositories|" \
+ -e "s|/home/git/gitlab-satellites|%{homedir}/satellites|" \
+ -e "s|/home/git/gitlab-shell|/usr/share/gitlab-shell|" \
+ config/gitlab.yml.example > config/gitlab.yml
+sed -e "s|/home/git/gitlab/tmp/.*/|/run/gitlab/|g" \
+ -e "s|/home/git/gitlab|%{homedir}|g" \
+ -e "s|/usr/share/gitlab/log|%{homedir}/log|g" \
+ -e "s|timeout 30|timeout 300|" \
+ config/unicorn.rb.example > config/unicorn.rb
+sed -e "s|username: git|username: gitlab|" \
+ config/database.yml.mysql > config/database.yml
+
+%build
+# Note: SSL error temporary fixed with 'sudo gem update --system' which updates
+# /usr/bin/gem
+#:<< _EOF
+bundle install %{_smp_mflags} \
+ --no-cache --no-prune --deployment --without development test aws
+
+%install
+rm -rf $RPM_BUILD_ROOT
+install -d \
+ $RPM_BUILD_ROOT%{homedir}/www \
+ $RPM_BUILD_ROOT%{homedir}/public/uploads \
+ $RPM_BUILD_ROOT%{_sysconfdir}/gitlab \
+ $RPM_BUILD_ROOT%{_docdir}/gitlab \
+ $RPM_BUILD_ROOT%{homedir}/satellites
+
+cp -a . $RPM_BUILD_ROOT%{homedir}
+
+# Creating links
+ln -fs /run/gitlab $RPM_BUILD_ROOT%{homedir}/pids
+ln -fs /run/gitlab $RPM_BUILD_ROOT%{homedir}/sockets
+ln -fs %{_localstatedir}/log/gitlab $RPM_BUILD_ROOT%{homedir}/log
+install -d %{_localstatedir}/log/gitlab
+
+# Install config files
+for f in gitlab.yml unicorn.rb database.yml; do
+ install -m0644 config/$f $RPM_BUILD_ROOT%{_sysconfdir}/gitlab/$f
+ [[ -f "$RPM_BUILD_ROOT%{homedir}/config/$f" ]] && rm $RPM_BUILD_ROOT%{homedir}/config/$f
+ ln -fs %{_sysconfdir}/gitlab/$f $RPM_BUILD_ROOT%{homedir}/config/
+done
+
+# Install systemd service files
+install -D %{S:1} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab.target
+install -D %{S:2} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab-sidekiq.service
+install -D %{S:3} $RPM_BUILD_ROOT%{systemdunitdir}/gitlab-unicorn.service
+install -D %{S:4} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/gitlab.logrotate
+install -D %{S:5} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/gitlab.conf
+install -D %{S:6} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/httpd.d/gitlab.conf
+
+%clean
+rm -rf "$RPM_BUILD_ROOT"
+
+%pre
+if [ $1 -ge 1 ]; then
+ %groupadd gitlab -g %{gitlab_gid}
+ %useradd -u %{gitlab_uid} -c 'Gitlab user' -d %{homedir} -g gitlab -s /bin/bash gitlab
+fi
+
+%post
+if [ $1 -ge 1 ]; then
+ systemctl -q daemon-reload
+ systemd-tmpfiles --create %{systemdtmpfilesdir}/gitlab.conf
+ [ -e %{_localstatedir}/lock/subsys/httpd ] && service httpd reload || :
+fi
+if [ $1 -eq 1 ]; then
+ systemctl -q enable gitlab-unicorn
+ systemctl -q enable gitlab-sidekiq
+ systemctl -q enable gitlab.target
+ systemctl -q start gitlab-unicorn
+ systemctl -q start gitlab-sidekiq
+ systemctl -q start gitlab.target
+ sudo -u gitlab -H git config --global user.name "GitLab"
+ sudo -u gitlab -H git config --global user.email "gitlab at localhost"
+ sudo -u gitlab -H git config --global core.autocrlf input
+ echo "Create and configure database in /etc/gitlab/database.yml"
+ echo "Then run 'sudo -u gitlab bundle exec rake gitlab:setup RAILS_ENV=production'"
+ echo
+else
+ systemctl -q try-restart gitlab-unicorn
+ systemctl -q try-start gitlab-sidekiq
+fi
+
+%postun
+if [ $1 -eq 0 ]; then
+ %userremove gitlab
+ %groupremove gitlab
+fi
+
+%files
+%defattr(644,root,root,755)
+%doc LICENSE
+%dir %{_sysconfdir}/gitlab
+%config(noreplace) %{_sysconfdir}/gitlab/database.yml
+%config(noreplace) %{_sysconfdir}/gitlab/gitlab.yml
+%config(noreplace) %{_sysconfdir}/gitlab/unicorn.rb
+%config(noreplace) %{_sysconfdir}/httpd/httpd.d/gitlab.conf
+/etc/logrotate.d/gitlab.logrotate
+%{systemdunitdir}/gitlab-sidekiq.service
+%{systemdunitdir}/gitlab-unicorn.service
+%{systemdunitdir}/gitlab.target
+%{systemdtmpfilesdir}/gitlab.conf
+%dir %attr(755,gitlab,gitlab) %{homedir}
+%dir %attr(755,gitlab,gitlab) %{homedir}/app
+%attr(-,gitlab,gitlab) %{homedir}/app/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/bin
+%attr(-,gitlab,gitlab) %{homedir}/bin/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/builds
+%attr(-,gitlab,gitlab) %{homedir}/builds/.gitkeep
+%dir %attr(755,gitlab,gitlab) %{homedir}/config
+%attr(-,gitlab,gitlab) %{homedir}/config/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/db
+%attr(-,gitlab,gitlab) %{homedir}/db/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/doc
+%attr(-,gitlab,gitlab) %{homedir}/doc/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/docker
+%attr(-,gitlab,gitlab) %{homedir}/docker/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/features
+%attr(-,gitlab,gitlab) %{homedir}/features/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/lib
+%attr(-,gitlab,gitlab) %{homedir}/lib/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/log
+%attr(-,gitlab,gitlab) %{homedir}/log/*
+%attr(-,gitlab,gitlab) %{homedir}/log/.gitkeep
+%dir %attr(755,gitlab,gitlab) %{homedir}/pids
+%dir %attr(755,gitlab,gitlab) %{homedir}/public
+%attr(-,gitlab,gitlab) %{homedir}/public/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/satellites
+%dir %attr(755,gitlab,gitlab) %{homedir}/scripts
+%attr(-,gitlab,gitlab) %{homedir}/scripts/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/sockets
+%dir %attr(755,gitlab,gitlab) %{homedir}/spec
+%attr(-,gitlab,gitlab) %{homedir}/spec/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/tmp
+%attr(-,gitlab,gitlab) %{homedir}/tmp/*
+%dir %{homedir}/vendor
+%{homedir}/vendor/*
+%dir %attr(755,gitlab,gitlab) %{homedir}/www
+
+%dir %attr(755,gitlab,gitlab) %{homedir}/.bundle
+%attr(-,gitlab,gitlab) %{homedir}/.bundle/config
+%attr(-,gitlab,gitlab) %{homedir}/.foreman
+%attr(-,gitlab,gitlab) %{homedir}/docker-compose.yml
+%attr(-,gitlab,gitlab) %{homedir}/.gitattributes
+%attr(-,gitlab,gitlab) %{homedir}/.*.yml
+%attr(-,gitlab,gitlab) %{homedir}/.rspec
+%attr(-,gitlab,gitlab) %{homedir}/.ruby-version
+%attr(-,gitlab,gitlab) %{homedir}/.simplecov
+%attr(-,gitlab,gitlab) %{homedir}/CHANGELOG
+%attr(-,gitlab,gitlab) %{homedir}/GITLAB_GIT_HTTP_SERVER_VERSION
+%attr(-,gitlab,gitlab) %{homedir}/GITLAB_SHELL_VERSION
+%attr(-,gitlab,gitlab) %{homedir}/Gemfile*
+%attr(-,gitlab,gitlab) %{homedir}/LICENSE
+%attr(-,gitlab,gitlab) %{homedir}/*.md
+%attr(-,gitlab,gitlab) %{homedir}/Procfile
+%attr(-,gitlab,gitlab) %{homedir}/Rakefile
+%attr(-,gitlab,gitlab) %{homedir}/VERSION
+%attr(-,gitlab,gitlab) %{homedir}/config.ru
diff --git a/gitlab-apache-conf b/gitlab-apache-conf
new file mode 100644
index 0000000..826c509
--- /dev/null
+++ b/gitlab-apache-conf
@@ -0,0 +1,44 @@
+#This configuration has been tested on GitLab 6.0.0 and GitLab 6.0.1
+#Note this config assumes unicorn is listening on default port 8080.
+#Module dependencies
+# mod_rewrite
+# mod_proxy
+# mod_proxy_http
+<VirtualHost *:80>
+ ServerName gitlab.example.com
+ ServerSignature Off
+
+ ProxyPreserveHost On
+
+ <Location />
+ # New authorization commands for apache 2.4 and up
+ # http://httpd.apache.org/docs/2.4/upgrading.html#access
+ Require all granted
+
+ ProxyPassReverse http://127.0.0.1:8080
+ ProxyPassReverse http://gitlab.openmamba.org/
+ </Location>
+
+ #apache equivalent of nginx try files
+ # http://serverfault.com/questions/290784/what-is-apaches-equivalent-of-nginxs-try-files
+ # http://stackoverflow.com/questions/10954516/apache2-proxypass-for-rails-app-gitlab
+ RewriteEngine on
+ RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
+ RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
+
+ # needed for downloading attachments
+ DocumentRoot /var/lib/gitlab/www/public
+
+ #Set up apache error documents, if back end goes down (i.e. 503 error) then a maintenance/deploy page is thrown up.
+ ErrorDocument 404 /404.html
+ ErrorDocument 422 /422.html
+ ErrorDocument 500 /500.html
+ ErrorDocument 503 /deploy.html
+
+ LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b" common_forwarded
+ ErrorLog /var/log/httpd/gitlab.example.com_error.log
+ CustomLog /var/log/httpd/gitlab.example.com_forwarded.log common_forwarded
+ CustomLog /var/log/httpd/gitlab.example.com_access.log combined env=!dontlog
+ CustomLog /var/log/httpd/gitlab.example.com.log combined
+
+</VirtualHost>
diff --git a/gitlab-sidekiq.service b/gitlab-sidekiq.service
new file mode 100644
index 0000000..8a3d227
--- /dev/null
+++ b/gitlab-sidekiq.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab Sidekiq Worker
+
+[Service]
+Type=forking
+User=gitlab
+WorkingDirectory=/var/lib/gitlab
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-sidekiq
+PIDFile=/var/lib/gitlab/pids/sidekiq.pid
+
+ExecStart=/var/lib/gitlab/bin/bundle exec "sidekiq -q post_receive,mailer,system_hook,project_web_hook,gitlab_shell,common,default -e production -P pids/sidekiq.pid -d -L log/sidekiq.log >> log/sidekiq.log 2>&1"
+ExecStop=/var/lib/gitlab/bin/bundle exec "sidekiqctl stop /var/lib/gitlab/pids/sidekiq.pid >> /var/lib/gitlab/log/sidekiq.log 2>&1"
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab-unicorn.service b/gitlab-unicorn.service
new file mode 100644
index 0000000..a0f31fb
--- /dev/null
+++ b/gitlab-unicorn.service
@@ -0,0 +1,24 @@
+#####################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+####################################################
+
+[Unit]
+Description=GitLab Unicorn Server
+
+[Service]
+User=gitlab
+WorkingDirectory=/var/lib/gitlab
+Environment=RAILS_ENV=production
+SyslogIdentifier=gitlab-unicorn
+PIDFile=/var/lib/gitlab/pids/unicorn.pid
+
+ExecStart=/var/lib/gitlab/bin/bundle exec "unicorn_rails -c /var/lib/gitlab/config/unicorn.rb -E production"
+ExecStop=kill -QUIT $MAINPID
+ExecReload=kill -USR2 $MAINPID
+
+[Install]
+WantedBy=gitlab.target
diff --git a/gitlab.logrotate b/gitlab.logrotate
new file mode 100644
index 0000000..5d3b064
--- /dev/null
+++ b/gitlab.logrotate
@@ -0,0 +1,21 @@
+/var/lib/gitlab/log/application.log
+/var/lib/gitlab/log/development.log
+/var/lib/gitlab/log/githost.log
+/var/lib/gitlab/log/production.log
+/var/lib/gitlab/log/sidekiq.log
+/var/lib/gitlab/log/unicorn.stderr.log
+/var/lib/gitlab/log/unicorn.stdout.log
+{
+ rotate 7
+ daily
+ maxsize 10M
+ minsize 1M
+ missingok
+ notifempty
+ compress
+ delaycompress
+ sharedscripts
+ postrotate
+ invoke-rc.d gitlab restart > /dev/null
+ endscript
+}
diff --git a/gitlab.target b/gitlab.target
new file mode 100644
index 0000000..d83e827
--- /dev/null
+++ b/gitlab.target
@@ -0,0 +1,15 @@
+###########################################################################################
+#
+# GitLab version : 5.x - 6.x
+# Contributors : davispuh, mtorromeo, axilleas, boeserwolf91
+# Downloaded from : https://github.com/gitlabhq/gitlab-recipes/tree/master/init/systemd
+#
+###########################################################################################
+
+[Unit]
+Description=GitLab - Self Hosted Git Management
+Requires=mysql.service redis.service
+After=redis.service mysql.service syslog.target network.target
+
+[Install]
+WantedBy=multi-user.target
diff --git a/gitlab.tmpfiles.d b/gitlab.tmpfiles.d
new file mode 100644
index 0000000..b359ba9
--- /dev/null
+++ b/gitlab.tmpfiles.d
@@ -0,0 +1 @@
+d /run/gitlab 0755 gitlab gitlab -
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gitlab-ce.git/commitdiff/edff9e1382a1a93a893fc3861a73d1c30db7d7de
More information about the pld-cvs-commit
mailing list