Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: fbe0d93783
Fetching contributors…

Cannot retrieve contributors at this time

file 69 lines (63 sloc) 2.024 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
#
# Cookbook Name:: gitolite
# Recipe:: default
#
# Copyright 2010, RailsAnt, Inc.
# Copyright 2012, Gerald L. Hevener Jr., M.S.
# Copyright 2012, Eric G. Wolfe
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
#
%w{ git perl }.each do |cb_include|
  include_recipe cb_include
end

# Add git user
# Password isn't set correctly in original recipe, and really no reason to set one.
user node['gitlab']['git_user'] do
  comment "Git User"
  home node['gitlab']['git_home']
  shell "/bin/bash"
  supports :manage_home => true
end

directory node['gitlab']['git_home'] do
  owner node['gitlab']['git_user']
  group node['gitlab']['git_group']
  mode 0750
end

%w{ bin repositories }.each do |subdir|
  directory "#{node['gitlab']['git_home']}/#{subdir}" do
    owner node['gitlab']['git_user']
    group node['gitlab']['git_group']
    mode 0775
  end
end

# Create a $HOME/.ssh folder
directory "#{node['gitlab']['git_home']}/.ssh" do
  owner node['gitlab']['git_user']
  group node['gitlab']['git_group']
  mode 0700
end

# Clone gitolite repo from github
git node['gitlab']['gitolite_home'] do
  repository node['gitlab']['gitolite_url']
  reference node['gitlab']['gitolite_ref']
  user node['gitlab']['git_user']
  group node['gitlab']['git_group']
  action :checkout
end

# Gitolite application install script
execute "gitolite-install" do
  user node['gitlab']['git_user']
  cwd node['gitlab']['git_home']
  command "#{node['gitlab']['gitolite_home']}/install -ln #{node['gitlab']['git_home']}/bin"
  creates "#{node['gitlab']['git_home']}/bin/gitolite"
end
Something went wrong with that request. Please try again.