Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
gitlab deploy tips

gitlab deploy tips

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

sudo yum install openssl-devel

sudo vim /etc/gitlab/gitlab.rb
sudo rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
sudo yum remove nginx
sudo yum install nginx


external_url ""
git_data_dir "/var/opt/gitlab/git-data"
gitlab_rails['backup_path'] = '/var/opt/gitlab/backups'
user['username'] = "gitlab"
user['group'] = "gitlab"
gitlab_rails['backup_keep_time'] = 604800

unicorn['port'] = 3456

# Disable the built-in nginx
nginx['enable'] = false

redis['enable'] = false

# Redis via TCP
gitlab_rails['redis_host'] = ''
gitlab_rails['redis_port'] = 6379

# OR Redis via Unix domain sockets
# sudo vim /etc/redis.conf
# gitlab_rails['redis_socket'] = '/tmp/redis.sock'


0 2 * * * /bin/bash -l -c '/opt/gitlab/bin/gitlab-rake gitlab:backup:create'

backup and restore

sudo gitlab-rake gitlab:backup:create

sudo cp 1393513186_gitlab_backup.tar /var/opt/gitlab/backups/

# Stop processes that are connected to the database
sudo gitlab-ctl stop unicorn
sudo gitlab-ctl stop sidekiq

# This command will overwrite the contents of your GitLab database!
sudo gitlab-rake gitlab:backup:restore BACKUP=1411990829

# Start GitLab
sudo gitlab-ctl start

sudo cp 1393513186_gitlab_backup.tar /opt/gitlab/backups/

sudo chown gitlab:nobody -R /var/opt/gitlab/gitlab-rails/
sudo chmod -R u+rwX /var/opt/gitlab/gitlab-rails/tmp/sockets/
sudo chmod -R 777 /var/opt/gitlab/gitlab-rails/

sudo gitlab-ctl reconfigure
sudo gitlab-ctl tail

sudo gitlab-rails console

# reinstall
sudo rpm -e gitlab
sudo rpm -i gitlab-7.1.1_omnibus-1.el6.x86_64.rpm
Copy link

maksha commented Feb 4, 2015


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment