Skip to content
Snippets Groups Projects
Commit d7ecaa27 authored by Marin Jankovski's avatar Marin Jankovski
Browse files

Add configuration recipe.

parent bbd71a81
No related branches found
No related tags found
No related merge requests found
default['cookbook-gitlab-runner']['docker-machine']['install'] = true
default['cookbook-gitlab-runner']['docker-machine']['version'] = "0.7.0"
default['cookbook-gitlab-runner']['docker-machine']['checksum'] = "21e490d5cdfa0d21e543e06b73180614f72e6c18a940f476a64cf084cea23aa5"
default['cookbook-gitlab-runner']['global_config'] = { "concurrent" => 1 }
default['cookbook-gitlab-runner']['runners'] = []
module QuoteHelper
def quote(value)
if value && value.is_a?(String)
"\"#{value}\""
else
value
end
end
end
Loading
Loading
@@ -5,5 +5,6 @@
# Copyright 2016, GitLab Inc.
#
 
include_recipe 'runner_install'
include_recipe 'docker_install'
include_recipe 'runner_install'
include_recipe 'runner_configure'
Loading
Loading
@@ -34,3 +34,10 @@ if node['cookbook-gitlab-runner']['docker-machine']['install']
not_if "/usr/bin/docker-machine --version | grep #{node['cookbook-gitlab-runner']['docker-machine']['version']}"
end
end
# Restart Docker after iptables-persistent for nat rules
template '/etc/rc.local' do
owner 'root'
group 'root'
mode '0755'
end
#
# Cookbook Name:: cookbook-gitlab-runner
# Recipe:: runner_configure
#
# Copyright 2016, GitLab Inc.
#
template '/etc/gitlab-runner/config.toml' do
source "config.toml.erb"
owner 'root'
group 'root'
mode '0600'
helpers QuoteHelper
variables(
global: node['cookbook-gitlab-runner']['global_config'],
runners: node['cookbook-gitlab-runner']['runners']
)
end
<% @global.each do |name, value| %>
<%= name %> = <%= value %>
<% end %>
<% @runners.each do |n, runner| %>
[[runners]]
<% if runner.has_key?('global') %>
<% runner['global'].each do |name, value| %>
<%= name %> = <%= quote(value) %>
<% end %>
<% end %>
<% if runner.has_key?('docker') %>
[runners.docker]
<% runner['docker'].each do |name, value| %>
<%= name %> = <%= quote(value) %>
<% end %>
<% end %>
<% if runner.has_key?('machine') %>
[runners.machine]
<% runner['machine'].each do |name, value| %>
<%= name %> = <%= quote(value) %>
<% end %>
<% end %>
<% if runner.has_key?('cache') %>
[runners.cache]
<% runner['cache'].each do |name, value| %>
<%= name %> = <%= quote(value) %>
<% end %>
<% end %>
<% end %>
#!/bin/sh -e
#
# rc.local
#
# Managed by Chef - Local Changes will be Nuked from Orbit
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
test -e /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server
# Restart docker after iptables-persistent for nat rules
/usr/sbin/service docker restart
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment