2015-09-30 13:48:42 +00:00
|
|
|
# encoding: utf-8
|
2015-09-23 10:21:10 +00:00
|
|
|
# Cookbook Name:: build-cookbook
|
|
|
|
# Recipe:: default
|
|
|
|
#
|
2015-09-30 13:48:42 +00:00
|
|
|
# Copyright (c) 2015 Chef Software Inc., All Rights Reserved.
|
|
|
|
|
2015-10-01 20:23:33 +00:00
|
|
|
include_recipe 'delivery-truck::default'
|
|
|
|
|
|
|
|
# create a persistant gem cache per builder for the entire project
|
|
|
|
gem_cache = File.join(node['delivery']['workspace']['root'], "../../../project_gem_cache")
|
|
|
|
directory gem_cache do
|
|
|
|
# set the owner to the dbuild so that the other recipes can write to here
|
|
|
|
owner node['delivery_builder']['build_user']
|
|
|
|
mode "0755"
|
|
|
|
recursive true
|
|
|
|
action :create
|
|
|
|
end
|
|
|
|
|
|
|
|
# ensure we always have a docker group with the build user as a member
|
2015-09-30 13:48:42 +00:00
|
|
|
group 'docker' do
|
|
|
|
members [node['delivery_builder']['build_user']]
|
|
|
|
end
|
|
|
|
|
2015-10-01 12:58:22 +00:00
|
|
|
package 'build-essential'
|
|
|
|
|
2015-10-01 20:23:33 +00:00
|
|
|
# get docker
|
2015-09-30 13:48:42 +00:00
|
|
|
docker_service 'dockerd' do
|
2015-10-02 15:34:57 +00:00
|
|
|
action [:create, :start]
|
2015-09-30 13:48:42 +00:00
|
|
|
host 'unix:///var/run/docker.sock'
|
|
|
|
group 'docker'
|
|
|
|
provider Chef::Provider::DockerService::Execute
|
|
|
|
end
|
|
|
|
|
|
|
|
log 'system info' do
|
|
|
|
message `uname -a; docker --version; ls -lha /var/run/docker.sock`
|
|
|
|
level :warn
|
|
|
|
end
|