mirror of
https://github.com/gitlabhq/gitlab-recipes.git
synced 2026-04-23 03:00:32 -04:00
Merge branch 'master' of github.com:gitlabhq/gitlab-recipes
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
|
||||
ProxyPass / http://127.0.0.1:3000/
|
||||
ProxyPassReverse / http://127.0.0.1:3000/
|
||||
ProxyPreserveHost On
|
||||
|
||||
CustomLog /var/log/apache2/gitlab/access.log combined
|
||||
ErrorLog /var/log/apache2/gitlab/error.log
|
||||
@@ -25,6 +26,7 @@
|
||||
|
||||
ProxyPass / http://127.0.0.1:3000/
|
||||
ProxyPassReverse / http://127.0.0.1:3000/
|
||||
ProxyPreserveHost On
|
||||
|
||||
CustomLog /var/log/apache2/gitlab/access.log combined
|
||||
ErrorLog /var/log/apache2/gitlab/error.log
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# GitLab
|
||||
# Maintainer: @elvanja, @troyanov
|
||||
# App Version: 4.0
|
||||
# Maintainer: @elvanja, @troyanov, @eiyaya
|
||||
# App Version: 4.1
|
||||
|
||||
# chkconfig: 2345 82 55
|
||||
# processname: unicorn
|
||||
# processname: rescue
|
||||
# description: Runs unicorn and resque for nginx integration.
|
||||
# processname: sidekiq
|
||||
# description: Runs unicorn and sidekiq for nginx integration.
|
||||
|
||||
# Related (kudos @4sak3n0ne):
|
||||
# https://github.com/gitlabhq/gitlabhq/issues/1049#issuecomment-8386882
|
||||
@@ -23,17 +23,17 @@ NAME=gitlab
|
||||
USER=$NAME
|
||||
APP_PATH=/home/$USER/gitlab
|
||||
|
||||
# The PID and LOCK files used by unicorn and resque
|
||||
# The PID and LOCK files used by unicorn and sidekiq
|
||||
UPID=$APP_PATH/tmp/pids/unicorn.pid
|
||||
ULOCK=/var/lock/subsys/unicorn
|
||||
RPID=$APP_PATH/tmp/pids/resque_worker.pid
|
||||
RLOCK=/var/lock/subsys/resque
|
||||
SPID=$APP_PATH/tmp/pids/sidekiq.pid
|
||||
SLOCK=/var/lock/subsys/sidekiq
|
||||
|
||||
# The options to use when running unicorn
|
||||
OPTS="-c $APP_PATH/config/unicorn.rb -E production -D"
|
||||
|
||||
# Ruby related path update
|
||||
RUBY_PATH_PATCH="PATH=$PATH:/usr/local/bin:/usr/local/lib && export PATH && "
|
||||
RUBY_PATH_PATCH="PATH=$PATH:/usr/local/bin:/usr/local/lib:/home/gitlab/bin && export PATH && "
|
||||
|
||||
start() {
|
||||
cd $APP_PATH
|
||||
@@ -45,14 +45,14 @@ start() {
|
||||
[ $unicorn -eq 0 ] && touch $ULOCK
|
||||
echo
|
||||
|
||||
# Start resque
|
||||
echo -n $"Starting resque: "
|
||||
daemon --pidfile=$RPID --user=$USER "$RUBY_PATH_PATCH ./resque.sh"
|
||||
resque=$?
|
||||
[ $resque -eq 0 ] && touch $RLOCK
|
||||
# Start sidekiq
|
||||
echo -n $"Starting sidekiq: "
|
||||
daemon --pidfile=$SPID --user=$USER "$RUBY_PATH_PATCH RAILS_ENV=production bundle exec rake sidekiq:start"
|
||||
sidekiq=$?
|
||||
[ $sidekiq -eq 0 ] && touch $SLOCK
|
||||
echo
|
||||
|
||||
retval=$unicorn || $resque
|
||||
retval=$unicorn || $sidekiq
|
||||
return $retval
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ stop() {
|
||||
[ $unicorn -eq 0 ] && rm -f $ULOCK
|
||||
echo
|
||||
|
||||
# Stop resque
|
||||
echo -n $"Stopping resque: "
|
||||
killproc -p $RPID
|
||||
resque=$?
|
||||
[ $resque -eq 0 ] && rm -f $RLOCK
|
||||
# Stop sidekiq
|
||||
echo -n $"Stopping sidekiq: "
|
||||
killproc -p $SPID
|
||||
sidekiq=$?
|
||||
[ $sidekiq -eq 0 ] && rm -f $SLOCK
|
||||
echo
|
||||
|
||||
retval=$unicorn || $resque
|
||||
retval=$unicorn || $sidekiq
|
||||
return $retval
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ restart() {
|
||||
|
||||
get_status() {
|
||||
status -p $UPID unicorn
|
||||
status -p $RPID resque
|
||||
status -p $SPID sidekiq
|
||||
}
|
||||
|
||||
query_status() {
|
||||
@@ -113,4 +113,4 @@ case "$1" in
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit 0
|
||||
@@ -94,6 +94,7 @@ Just make sure it is started at the next reboot
|
||||
*logged in as root*
|
||||
|
||||
chkconfig redis on
|
||||
service redis start
|
||||
|
||||
## Configure mysql
|
||||
Make sure it is started at the next reboot and start it immediately so we can configure it.
|
||||
|
||||
@@ -172,7 +172,7 @@ sudo chown git:git /home/git/.gitolite/hooks/common/post-receive
|
||||
|
||||
sudo -u gitlab -H bundle exec rake gitlab:app:setup RAILS_ENV=production
|
||||
|
||||
sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/init.d/gitlab -P /etc/init.d/
|
||||
sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/4-0-stable/init.d/gitlab -P /etc/init.d/
|
||||
sudo chmod +x /etc/init.d/gitlab
|
||||
|
||||
sudo update-rc.d gitlab defaults 21
|
||||
@@ -182,7 +182,7 @@ sudo update-rc.d gitlab defaults 21
|
||||
#== 7. Nginx
|
||||
#==
|
||||
sudo apt-get install -y nginx
|
||||
sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/master/nginx/gitlab -P /etc/nginx/sites-available/
|
||||
sudo wget https://raw.github.com/gitlabhq/gitlab-recipes/4-0-stable/nginx/gitlab -P /etc/nginx/sites-available/
|
||||
sudo ln -s /etc/nginx/sites-available/gitlab /etc/nginx/sites-enabled/gitlab
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# GITLAB
|
||||
# Maintainer: @randx
|
||||
# App Version: 4.0
|
||||
# App Version: 5.0
|
||||
|
||||
upstream gitlab {
|
||||
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
|
||||
@@ -9,7 +9,7 @@ upstream gitlab {
|
||||
server {
|
||||
listen YOUR_SERVER_IP:80 default_server; # e.g., listen 192.168.1.1:80;
|
||||
server_name YOUR_SERVER_FQDN; # e.g., server_name source.example.com;
|
||||
root /home/gitlab/gitlab/public;
|
||||
root /home/git/gitlab/public;
|
||||
|
||||
# individual nginx logs for this gitlab vhost
|
||||
access_log /var/log/nginx/gitlab_access.log;
|
||||
|
||||
Reference in New Issue
Block a user