@@ -38,7 +38,7 @@ group :development do
38
38
gem "rubocop-factory_bot" , '~> 2.27.1' , require : false
39
39
gem "rubocop-capybara" , '~> 2.22.1' , require : false
40
40
gem "rb-readline" , '= 0.5.5' , require : false , platforms : [ :mswin , :mingw , :x64_mingw ]
41
- gem "bolt" , '>= 4.0.0' , require : false
41
+ # gem "bolt", '>= 4.0.0', require: false
42
42
gem "github_changelog_generator" , '1.16.4' , require : false
43
43
gem "octokit" , '4.21.0' , require : false
44
44
gem "orchestrator_client" , '< 0.7.1' , require : false
55
55
puppet_version = ENV [ 'PUPPET_GEM_VERSION' ]
56
56
facter_version = ENV [ 'FACTER_GEM_VERSION' ]
57
57
hiera_version = ENV [ 'HIERA_GEM_VERSION' ]
58
+ bolt_version = ENV . fetch ( 'BOLT_GEM_VERSION' , nil )
58
59
59
60
gems = { }
60
61
61
- gems [ 'puppet' ] = location_for ( puppet_version )
62
+ # If PUPPET_FORGE_TOKEN is set then use authenticated source for both puppet and facter, since facter is a transitive dependency of puppet
63
+ # Otherwise, do as before and use location_for to fetch gems from the default source
64
+ if !ENV [ 'PUPPET_FORGE_TOKEN' ] . to_s . empty?
65
+ gems [ 'bolt' ] = [ bolt_version || '~> 5.0' , { require : false , source : 'https://rubygems-puppetcore.puppet.com' } ]
66
+ gems [ 'puppet' ] = [ puppet_version || '~> 8.11' , { require : false , source : 'https://rubygems-puppetcore.puppet.com' } ]
67
+ gems [ 'facter' ] = [ facter_version || '~> 4.0' , { require : false , source : 'https://rubygems-puppetcore.puppet.com' } ]
68
+ else
69
+ gems [ 'bolt' ] = location_for ( bolt_version )
70
+ gems [ 'puppet' ] = location_for ( puppet_version )
71
+ gems [ 'facter' ] = location_for ( facter_version ) if facter_version
72
+ end
62
73
63
- # If facter or hiera versions have been specified via the environment
74
+ # If hiera version have been specified via the environment
64
75
# variables
65
- gems [ 'facter' ] = location_for ( facter_version ) if facter_version
66
76
gems [ 'hiera' ] = location_for ( hiera_version ) if hiera_version
67
77
68
78
gems . each do |gem_name , gem_params |
0 commit comments