From 781200ac4dbd6f07ed62a412458c9c4993f8282d Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Fri, 27 Apr 2012 14:16:10 -0400 Subject: [PATCH] Adds ccache to jenkins slaves. Creates symlinks in /usr/local/bin to automatically use ccache and also fix some spacing issues. Symlink files depend on ccache to prevent dangling links. Addresses bug 989724. Change-Id: I889ef377efd9a512dfec78c3c417931a764e514c --- modules/jenkins_slave/manifests/init.pp | 45 ++++++++++++++++++++----- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/modules/jenkins_slave/manifests/init.pp b/modules/jenkins_slave/manifests/init.pp index 20ad2864fc..022d2a2ec7 100644 --- a/modules/jenkins_slave/manifests/init.pp +++ b/modules/jenkins_slave/manifests/init.pp @@ -24,6 +24,7 @@ class jenkins_slave($ssh_key) { "autoconf", "automake", "build-essential", + "ccache", "cdbs", "curl", "debootstrap", @@ -108,17 +109,45 @@ class jenkins_slave($ssh_key) { cron { "tmpreaper": user => jenkins, ensure => 'absent', - } + } - file { 'jenkinslogs': + file { 'jenkinslogs': name => '/var/log/jenkins/tmpreaper.log*', ensure => 'absent', - } + } - file { 'jenkinslogdir': - name => '/var/log/jenkins', - ensure => 'absent', - force => true, - } + file { 'jenkinslogdir': + name => '/var/log/jenkins', + ensure => 'absent', + force => true, + } + + file { 'ccachegcc': + name => '/usr/local/bin/gcc', + ensure => link, + target => '/usr/bin/ccache', + require => Package['ccache'], + } + + file { 'ccacheg++': + name => '/usr/local/bin/g++', + ensure => link, + target => '/usr/bin/ccache', + require => Package['ccache'], + } + + file { 'ccachecc': + name => '/usr/local/bin/cc', + ensure => link, + target => '/usr/bin/ccache', + require => Package['ccache'], + } + + file { 'ccachec++': + name => '/usr/local/bin/c++', + ensure => link, + target => '/usr/bin/ccache', + require => Package['ccache'], + } }