Git comes with built-in GUI tools for committing and browsing , but there are several third-party tools for users looking for platform-specific experience.If you want to add another GUI tool to this list, just follow the instructions. All Windows Mac Linux Android iOS. Project ID: 1224398 Star 0. 111 Commits; 2 Branches; 0 Tags; 522 KB Files; 522 KB Storage Storage.
Summary
Gitlab is self hosted Git management software, notonly that but it’s also free and open-source.
While Gitlab has a brilliant installationguideavailable, it is focused on Ubuntu/Debian and not all those instructionscarry over to OS X so after a bit of tinkering I’ve put together thisguide for anyone else looking to run Gitlab on OS X.
I’ll be working on 10.8 (Mountain Lion) but these instructions will mostlikely work on 10.7 (Lion) as well. My original install of Gitlab was onan Xserve machine that also had OS XServer installed so these stepswill work with that also.
Disclaimer
This guide has allowed me to setup Gitlab (v4.2) on a private localnetwork with around 10 users and nearly 200 repositories. Any seriousproduction use I highly recommend using system Gitlab recommends toallow for consistent support and I accept no responsibility for anyproblems you encounter while following this guide.
I have only managed to get Gitlab 4.2 working on OS X so far which usesGitolite so this guide will be installing Gitlab 4.2 and assumes a cleaninstallation of OS X.
Requirements
The Gitlab team suggests at least 1GB RAM in your machine to run theGitlab application, since Mountain Lion requires about 2GB+ RAM you cango ahead and tick that off the list.
Install Command Line Tools and Homebrew
If you don’t have Homebrew installedalready then before you start copy & pasting into Terminal you hadbetter check you have Command LineTools installed first. Donethat? OK, time to install Homebrew.
A simple script that will automatically install Homebrew on yourmachine, once it’s done we need to check it’s all working and update theformulas.
Packages and dependencies
We actually have most of what we need on OS X already, but we aremissing a few core packages that we’ll install with Homebrew now, theseare mainly required for RVM to compile Ruby a little later on. Some ofthe other packages such as MySQL and Redis I will go through separately.
What’s better than one Python? Two apparently!
We need to create a symlink to Python for compatibility reasons notrelating to OS X but for some other Linux distributions that are inlimbo between version 2 and 3 of Python.
We also need to install Pygments for colourful syntax highlighting.
Create user accounts
Gitolite and Gitlab need a user to operate as. In OS X you can createthis user using the GUI via System Preferences or via the command linelike we are about to do. For this example I recommend the command linedue to the extra options we need to set.
The Git user![]()
Create a new group called
git with the ID of 1050 .
Now we create a
git user account with the recently created git groupas the primary group.
The Gitlab user
Now we have a
git user for Gitolite, we want to create the applicationuser for Gitlab this time with id 1051 .
Install and setup Gitolite
Clone GitLab’s fork of the Gitolite source code:
https://winterrenew515.weebly.com/excel-image-assistant-mac-download.html. Setup Gitolite with Gitlab as its admin. Important Note: GitLabassumes full and unshared control over this Gitolite installation.
Fix the directory permissions for the configuration directory:
Fix the directory permissions for the repositories:
Add domains to the list of known_hosts
To avoid problems later we will be manually adding the system theknown_hosts file of the gitlab user. We will do this for a couple ofhostnames.
That’s the
localhost added but we should also add the machines.local hostname too. For server using an external FQDN you will seethat hostname returned and not a .local .
By using a
.local domain you are only able to access Gitlab on yourlocal network. It is possible to expand this to the outside world butthis involves opening ports on your router and mapping your external IPaddress to a FQDN. All of which is outside the scope of this guide.
Test everything works so far
If you can’t clone the
gitolite-admin repository: DO NOT PROCEEDWITH INSTALLATION! Check the Trouble ShootingGuideand make sure you have followed all of the above steps carefully.
Install and setup MySQL Database for Gitlab
Gitlab recommends MySQL as the datastore so we’ll follow thatrecommendation. You may already have MySQL installed, if you have and itwas installed using Homebrew you will just need to move the
.plist file from ~/Library/LaunchAgents to /Library/LaunchDaemons as thiswill start the service when the machine starts instead of when your userlogs in otherwise Gitlab won’t be available unless you login which isnot what we want.
Run the following commands as your
sudo capable user.
Install and setup Redis
Gitlab uses the fantastic Sidekiqproject to handle the scheduling of background jobs such as sending outemails and repo management tasks. Sidekiq uses Redisas a datastore so let’s set that up now. We will also want Redis tostart up with the machine so we will be adding it to the
LaunchDaemons directory also.
This will run Redis with defaults, you can change these defaults but todo so I recommend duplicating the defaults first so you always have areference. You can update
/Library/LaunchDaemons/homebrew.mxcl.redis.plist to the new configlocation. It’s also best the run Redis with daemonize set to no sothat OS X can manage the process correctly.
Install RVM and Ruby
Before we start trying to install RVM we need to login as the right userto make thing easier. Only the
gitlab user will need RVM and Rubyinstalled.
We will be using RVM to install Ruby. Ricoh aficio sp 4310n driver. I’m installingRuby 1.9.3 as at the time of writing this is the supported version forGitlab. If you have any problems installing Ruby you should check
rvm requirements to make sure you have everything it needs installed —this guide should remain correct but just incase.
Create RVM Gemset for Gitlab
How much is crossover for mac. With Ruby installed and our shell now running the correct version ofRuby we need to make a gemset to make it easier to manage the gems wewill install for Gitlab. We then set this gemset as the default. Afterthis is done we need Bundler installed to thatgemset.
Install and setup Gitlab!
Train marry me mp3 download. At last now we are going to clone the Gitlab repository and setup theapplication.
We are using branch
4-2-stable because at the time of writing this isthe branch I have working.
Configure GitlabConfigure Gitlab database settings
Since we’re using MySQL we want to use the
database.yml template forMySQL. Make sure to update username/password in config/database.yml. Ihope you’re keeping up!
Install gems
Using Bundler we can install all the gems required by Gitlab, we will beinstalling the gems without the
development , test and postgresql groups as we won’t be needing those.
Gitlab Windows DownloadConfigure Git
GitLab needs to be able to commit and push changes to Gitolite. In orderto do that Git requires a username and email. (It’s recommended to usethe same address used for the email.from setting in config/gitlab.yml)
Setup GitLab Hooks
This will setup the custom hooks between Gitlab and Gitolite.
Initialise database and activate features
Now it’s time to initialise the Gitlab database by running all themigrations and adding the first admin user. Make a note of thecredentials it gives you at the end so you can login. Arma 3 life police download.
With that done run the following command to output and the environmentinfo used by Gitlab so you check it all looks right for your machine.
Quick test
Let’s skip ahead quickly a check out Gitlab! You won’t be able to makeany projects as Sidekiq is not running but it shows that all the workabove has achieved something. Use the credentials from above to login.
Open
http://127.0.0.1:3000 in your browser. Use ctrl + c to close theserver once you’ve had a look. It will be quite slow initially as it isonly intended as a development webserver.
Setting up Gitlab with Apache and Unicorn
Since OS X comes with Apache we will use that as our webserver toGitlab. You can of course use Nginx if youdesire but I will not be going over that option in this guide yet.Although I hope to go over that option in the future.
Configure UnicornSetup Gitlab Runner On Mac
Although not 100% compatible with Apache for variousreasons,Unicorn will be responsible for processing the Gitlab application. Weneed to a make a few alterations to the config to make it “OS Xfriendly”.
Unicorn needs to startup with the machine but we need to do some workwith RVM. We need to make a wrapper around the
bundle command so itcan be used at bootup.
Now we can make a
launchctl plist file. I’ve created these plists foryou and saved them as a(gist)[https://gist.github.com/createdbypete/5345563] so you can grabthat directly:
Please note: Unicorn can take a few seconds to start up.
Configure Sidekiq
We also need Sidekiq to start up with the machine, thankfully the stepsabove have shortened some of the work we need to do now and we only needto create the plist as the
bundle wrapper is already available. Theplist command used below is an extraction from the raketaskthat should be used but it is not compatible with OS X.
Configure Apache
In Mountain Lion Apple decided to remove the web sharing option from theSystem Preferences panel but Apache is still there so it just means weneed to start it via terminal.
We need to tell Apache about Gitlab by creating a configuration for it.Thankfully Apache on OS X loads in all
.conf files in the/etc/apache2/other/ Microsoft remote desktop mac printer redirection not working. directory so we can create a file in there toavoid tampering with the main config, this is also easier to manage.
Gitlab Download Mac Os X 10.13
OS X Server People Download maxthon browser latest version. You can use the Server.app to setup a newVirtualHost and Allow Overrides. You can then edit the generatedconfiguration file as required to match thegist.
Now you can open
http://my-hostname.local in your browser and youshould be greeted by the Gitlab login screen. Again use the details fromearlier:
Important Note: This user should be disabled or deleted once youhave got some real users in place with administrator privileges.
Enjoy!
If all this is too much for you I recommend checking out the GitLabpaid service. Huge thanks to the GitLabTeam and all the contributors.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2020
Categories |