2 # Cookbook Name:: gitlab-grid
5 # Copyright 2017, whitestar
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
20 # https://about.gitlab.com/downloads/
22 #::Chef::Recipe.send(:include, PlatformUtils::VirtUtils)
24 include_recipe 'gitlab-grid::commons'
26 #config = node['gitlab-grid']['gitlab.rb']
27 #override_config = node.override['gitlab-grid']['gitlab.rb']
28 #force_override_config = node.force_override['gitlab-grid']['gitlab.rb']
30 case node['platform_family']
39 resources(package: pkg) rescue package pkg do
48 resources(service: srv) rescue service srv do
49 action [:enable, :start]
53 bash 'update_firewall' do
55 firewall-cmd --permanent --add-service=http
56 systemctl reload firewalld
61 execute 'add_yum_repo_gitlab-ce' do
62 command 'curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | bash'
64 not_if { File.exist?('/etc/yum.repos.d/gitlab_gitlab-ce.repo') }
73 resources(package: pkg) rescue package pkg do
78 apt_get_update = 'apt-get_update'
79 resources(execute: apt_get_update) rescue execute apt_get_update do
80 command 'apt-get update'
84 execute 'add_apt_source_gitlab-ce' do
85 command 'curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash'
87 not_if { File.exist?('/etc/apt/sources.list.d/gitlab_gitlab-ce.list') }
88 notifies :run, "execute[#{apt_get_update}]", :immediately
95 resources(package: pkg) rescue package pkg do
100 template '/etc/gitlab/gitlab.rb' do
101 source 'etc/gitlab/gitlab.rb'
109 Note: You must execute the following command manually if the gitlab.rb file has been updated.
110 $ sudo gitlab-ctl reconfigure