This vagrant environment configures a basic GitLab Community Edition installation using the Omnibus GitLab package.
Nginx (HTTP/2 enabled) is configured with a self-signed certificate at:
PostgreSQL is configured to allow (and trust) any connection from the host. For example, you can use pgAdmin III with these settings:
Host: gitlab.example.com
Port: 5432
Maintenance DB: postgres
Username: gitlab-psql
GitLab is also configured to use the optional ldaps://dc.example.com
Active Directory LDAP endpoint as configured by rgl/windows-domain-controller-vagrant.
Some example repositories are automatically installed, if you do not want that, comment the line that calls create-example-repositories.sh
inside the provision.sh
file before running vagrant up
.
Install the Ubuntu Base Box.
Install the needed plugins:
vagrant plugin install vagrant-triggers # see https://github.com/emyl/vagrant-triggers
Start the environment:
vagrant up
Configure your host system to resolve the gitlab.example.com
domain to this vagrant environment IP address, e.g.:
echo '192.168.33.20 gitlab.example.com' | sudo tee -a /etc/hosts
Sign In into GitLab using the root
username and the password
password at:
Add your public SSH key, for that open the SSH Keys page at:
Add a new SSH key with your SSH public key, for that, just copy the contents of
your id_rsa.pub
file. Get its contents with, e.g.:
cat ~/.ssh/id_rsa.pub
Create a new repository named hello
at:
You can now clone that repository with SSH or HTTPS:
git clone [email protected]:root/hello.git
git clone https://[email protected]/root/hello.git
NB This vagrant environment does not have a proper SSL certificate, as such,
HTTPS cloning will fail with SSL certificate problem: self signed certificate
.
To temporarily ignore that error set the GIT_SSL_NO_VERIFY
environment
variable
with export GIT_SSL_NO_VERIFY=true
.
Make some changes to the cloned repository and push them:
cd hello
echo '# Hello World' >> README.md
git add README.md
git commit -m 'some change'
git push
You can also use Git Large File Storage (LFS). As this is an external Git plugin, you need to install git-lfs before you continue.
NB git-lfs
needs to be on your PATH
. Normally the installer configures
your system PATH
, but you still need to restart your shell or Git Client
application for it to pick it up.
Give it a try by cloning the example repository (created by create-example-repositories.sh):
git clone https://root:[email protected]/root/use-git-lfs.git
NB git-lfs
always uses an https
endpoint (even when you clone with ssh
).
Lets get familiar with git-lfs
by running some commands.
See the available lfs commands:
git lfs
Which file patterns are currently being tracked:
git lfs track
NB do not forget, only the tracked files are put outside the git repository. So don't forget to
track. e.g., with git lfs track "*.iso"
.
See which files are actually tracked:
git lfs ls-files
See the git-lfs
environment:
git lfs env
For more information read the tutorial and the documentation.
Watch the logs:
sudo su
tail -f /var/log/gitlab/gitlab-rails/*.log