From cd4ecaab02d2e0e0c0e22db60a22bdcb5ff82878 Mon Sep 17 00:00:00 2001 From: Alex Slynko Date: Mon, 5 Jan 2015 17:10:11 +0000 Subject: [PATCH] Add stable source support for package installation --- attributes/master.rb | 16 ++++++++++++++++ recipes/_master_package.rb | 8 ++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/attributes/master.rb b/attributes/master.rb index ed592a6861..bd49e59533 100644 --- a/attributes/master.rb +++ b/attributes/master.rb @@ -191,4 +191,20 @@ # node.set['jenkins']['master']['runit']['sv_timeout'] = 60 # master['runit']['sv_timeout'] = 7 + + # + # Repository URL. Default is latest + # + master['repository'] = case node['platform_family'] + when 'debian' then 'http://pkg.jenkins-ci.org/debian' + when 'rhel' then 'http://pkg.jenkins-ci.org/redhat' + end + + # + # Repository key. Default is latest + # + master['repository_key'] = case node['platform_family'] + when 'debian' then 'http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key' + when 'rhel' then 'http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key' + end end diff --git a/recipes/_master_package.rb b/recipes/_master_package.rb index 3bb4a99ffc..9cc753abc5 100644 --- a/recipes/_master_package.rb +++ b/recipes/_master_package.rb @@ -26,9 +26,9 @@ include_recipe 'apt::default' apt_repository 'jenkins' do - uri 'http://pkg.jenkins-ci.org/debian' + uri node['jenkins']['master']['repository'] distribution 'binary/' - key 'https://jenkins-ci.org/debian/jenkins-ci.org.key' + key node['jenkins']['master']['repository_key'] end package 'jenkins' do @@ -44,8 +44,8 @@ include_recipe 'yum::default' yum_repository 'jenkins-ci' do - baseurl 'http://pkg.jenkins-ci.org/redhat' - gpgkey 'https://jenkins-ci.org/redhat/jenkins-ci.org.key' + baseurl node['jenkins']['master']['repository'] + gpgkey node['jenkins']['master']['repository_key'] end package 'jenkins' do