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

Allow more configuration of the config.toml and docker installation

parent 439dd7bf
No related branches found
No related tags found
No related merge requests found
default['cookbook-gitlab-runner']['config_path'] = '/etc/gitlab-runner/config.toml'
default['cookbook-gitlab-runner']['docker-engine']['install'] = true
default['cookbook-gitlab-runner']['docker-engine']['keyserver'] = 'hkp://p80.pool.sks-keyservers.net:80'
default['cookbook-gitlab-runner']['docker-engine']['key'] = '58118E89F3A912897C070ADBF76221572C52609D'
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'] = []
Loading
Loading
@@ -5,34 +5,35 @@
# Copyright 2016, GitLab Inc.
#
 
case node['platform_family']
when 'debian'
apt_repository 'docker' do
uri 'https://apt.dockerproject.org/repo'
components ['main']
distribution "#{node['platform']}-#{node['lsb']['codename']}"
keyserver 'hkp://p80.pool.sks-keyservers.net:80'
key '58118E89F3A912897C070ADBF76221572C52609D'
end
when 'rhel'
yum_repository 'docker' do
description 'Docker yum repository'
baseurl 'https://yum.dockerproject.org/repo/main/centos/$releasever/'
gpgkey 'https://yum.dockerproject.org/gpg'
if node['cookbook-gitlab-runner']['docker-engine']['install']
case node['platform_family']
when 'debian'
apt_repository 'docker' do
uri 'https://apt.dockerproject.org/repo'
components ['main']
distribution "#{node['platform']}-#{node['lsb']['codename']}"
keyserver node['cookbook-gitlab-runner']['docker-engine']['keyserver']
key node['cookbook-gitlab-runner']['docker-engine']['key']
end
when 'rhel'
yum_repository 'docker' do
description 'Docker yum repository'
baseurl 'https://yum.dockerproject.org/repo/main/centos/$releasever/'
gpgkey 'https://yum.dockerproject.org/gpg'
end
end
end
 
package 'docker-engine'
 
if node['cookbook-gitlab-runner']['docker-machine']['install']
remote_file '/usr/bin/docker-machine' do
source "https://github.com/docker/machine/releases/download/v#{node['cookbook-gitlab-runner']['docker-machine']['version']}/docker-machine-Linux-x86_64"
owner 'root'
group 'root'
mode '0755'
checksum node['cookbook-gitlab-runner']['docker-machine']['checksum']
not_if "/usr/bin/docker-machine --version | grep #{node['cookbook-gitlab-runner']['docker-machine']['version']}"
end
remote_file '/usr/bin/docker-machine' do
source "https://github.com/docker/machine/releases/download/v#{node['cookbook-gitlab-runner']['docker-machine']['version']}/docker-machine-Linux-x86_64"
owner 'root'
group 'root'
mode '0755'
checksum node['cookbook-gitlab-runner']['docker-machine']['checksum']
only_if { node['cookbook-gitlab-runner']['docker-machine']['install'] }
not_if "/usr/bin/docker-machine --version | grep #{node['cookbook-gitlab-runner']['docker-machine']['version']}"
end
 
# Restart Docker after iptables-persistent for nat rules
Loading
Loading
Loading
Loading
@@ -6,7 +6,8 @@
#
 
 
template '/etc/gitlab-runner/config.toml' do
template 'config.toml' do
path node['cookbook-gitlab-runner']['config_path']
source "config.toml.erb"
owner 'root'
group 'root'
Loading
Loading
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