This is merely a collected records of my experience to setup DevOps infrastructure with Gitlab, Gitlab-CI, and Dokku.
Our setup uses virtual environment which is run on Proxmox VE with LXC as OS-level virtualization for Gitlab/Gitlab-CI server, and KVM as hypervisor for Dokku server (virtual machine). The first thing to do is to setup the virtual servers through web-based management of Proxmox VE. We allocate one CPU and 2048 MB of RAM for each virtual server.
There are steps for doing setup of virtual server and thankfully these are provided as a wizard in Proxmox VE. For LXC, our steps are described below.
# adduser stwn # visudo
$ ssh stwn@gitlab-server
$ sudo apt-get update
$ sudo apt-get install curl screen
$ curl -LJO https://packages.gitlab.com/gitlab/gitlab-ce/packages/ubuntu/trusty/gitlab-ce_8.6.6-ce.0_amd64.deb/download
$ sudo dpkg -i gitlab-ce_8.6.6-ce.0_amd64.deb
sudo gitlab-ctl reconfigure
$ sudo nano /etc/gitlab/gitlab.rb
Uncomment these lines.
web_server['external_users'] = [] web_server['username'] = 'gitlab-www' web_server['group'] = 'gitlab-www'
$ sudo gitlab-ctl reconfigure $ sudo gitlab-ctl restart
Use this command to see the log of Gitlab.
$ sudo gitlab-ctl tail
$ sudo nano /etc/network/interfaces
Put these lines in that file.
iface eth0 inet static address 10.16.7.128 netmask 255.255.248.0 gateway 10.16.7.1 dns-nameservers 10.16.7.1
$ sudo nano /etc/apt/sources.list
$ sudo apt-get update $ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
$ wget https://raw.githubusercontent.com/dokku/dokku/v0.5.5/bootstrap.sh
$ sudo DOKKU_TAG=v0.5.5 bash bootstrap.sh
We need to relax waiting for this command to complete. It depends on the Internet connection. Please watch the network status of the server, if it has on going/active traffic then the script must be working and we should be sit back while it really accomplishes its mission :D
$ ssh-keygen -t rsa $ cat .ssh/id_rsa.pub