The Blog

Get the Most out of the GitLab Template in Skytap Cloud

Last week we delivered to you a GitLab Public Template built on our new Ubuntu 12.0.4.1 template. GitLab is a self-hosted Git management server (think GitHub, but hosted by you). It is a fast, secure, and stable solution with a management UI built on Ruby on Rails and Git functionality is provided by Gitolite. You can find additional information on the GitLab website, and the code can be found on GitHub.

Now that you have the template, some may be asking what can actually be done with it. Simply put, you now have enterprise-level Git hosting at your fingertips. So let’s grab the keys and take this new template out for a spin.

To start, you need to get GitLab up and running. This should be fairly painless. Follow these 5 steps:

Log in to Skytap

Click the Templates tab

Search for GitLab

Highlight the template and click New Configuration

Click Run

Next, add a client machine so you can do administration while using GitLab. Follow these 5 steps:

Click Add VMs

Search for Ubuntu

Select the Ubuntu 12.04 LTS Desktop Linux template

Click Add

Click Run

Once the new client VM spins up, connect to it via SmartClient and log in (use the Skytap account in the credentials section of SmartClient. Once inside the client VM, start Firefox (Applications > Internet > Firefox Web Browser) and we’ll configure GitLab.

In the browser address bar, type: http://host-1 (Note: If that doesn’t work, double-check the Network name associated with the GitLab VM on the Skytap configuration page.)

Log in as:

User – admin@local.host

Pass – 5iveL!fe

Click Admin at top of page

Click Users

Click the New User button

Fill out the form for your new user (Note: I’m going to use the following, which I will assume you have as well):

User – skytap

Email – skytap@local.host

Password – skytap

Click Save

Log out as Admin at the top right of the page

Now that you have a regular user in GitLab, you can set that user up to connect to GitLab via Git. This will require installing a few software packages on our client and also creating an ssh key to give to GitLab.

Log in to GitLab using your new user account

User – skytap@local.host

Password – skytap

Click Account Settings

Click on the ssh keys tab

Click Add New

Add a title (it is mainly there so you can differentiate between ssh keys)

Create the key itself

Open the terminal (Applications > Accessories >Terminal)

Type the following (Hit enter to accept the defaults while the key is being built):

Copy the entire output of the cat command (should start with ssh-rsa and end with skytap@local.host)

Paste your public ssh key into the Key section of the form in GitLab and click Save

Since you already have a terminal window open, add the Git tools to your client (as well as Node.js and get a sample application as well):

Now you are set up on the client and ready to create your first project in GitLab. You can go back to your web browser and click the GitLab image on the upper left-hand side of the page. This will put you back on the main dashboard page.

Next, complete the following:

Click Create New Project in Firefox

Use whatever project name you prefer

I’m going to use express_sample and will assume you have as well

Now GitLab has done you a huge favor. It tells you how to create your Git library from within terminal, so give it a try. Open up terminal again and execute the following commands to initialize your remote Git repository on GitLab:

That does it. You should now have your new project checked in to the GitLab remote repository hosted in Skytap. You can click the Home button in GitLab and poke around inside of your new project, view files, etc.

To make things easier, we’ve put the client into the same Skytap configuration as GitLab. You could, however, use the ICNR functionality to have GitLab in one configuration and your client in another. You could also use the Skytap VPN functionality to make GitLab in Skytap available to local development clients.