Mercurial > repos > other > Puppet
annotate modules/mysql/Gemfile @ 385:d9009f54eb23
Migrate to a fully-fledged SSH module
This handles lots of the server path differences for us
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Jan 2022 17:05:54 +0000 |
parents | 48d3a1948e4d |
children |
rev | line source |
---|---|
244 | 1 source ENV['GEM_SOURCE'] || 'https://rubygems.org' |
2 | |
3 def location_for(place_or_version, fake_version = nil) | |
4 git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?} | |
5 file_url_regex = %r{\Afile:\/\/(?<path>.*)} | |
6 | |
7 if place_or_version && (git_url = place_or_version.match(git_url_regex)) | |
8 [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact | |
9 elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) | |
10 ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] | |
11 else | |
12 [place_or_version, { require: false }] | |
13 end | |
14 end | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
15 |
244 | 16 ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments |
17 minor_version = ruby_version_segments[0..1].join('.') | |
18 | |
19 group :development do | |
20 gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') | |
21 gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') | |
22 gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') | |
23 gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9') | |
24 gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) | |
25 gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) | |
26 gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] | |
27 gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] | |
28 gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby] | |
29 gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] | |
30 gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] | |
31 gem "puppet-lint-i18n", require: false | |
32 gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2') | |
26
58d1818c2ded
Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents:
0
diff
changeset
|
33 end |
58d1818c2ded
Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents:
0
diff
changeset
|
34 |
244 | 35 puppet_version = ENV['PUPPET_GEM_VERSION'] |
36 facter_version = ENV['FACTER_GEM_VERSION'] | |
37 hiera_version = ENV['HIERA_GEM_VERSION'] | |
38 | |
39 gems = {} | |
40 | |
41 gems['puppet'] = location_for(puppet_version) | |
42 | |
43 # If facter or hiera versions have been specified via the environment | |
44 # variables | |
45 | |
46 gems['facter'] = location_for(facter_version) if facter_version | |
47 gems['hiera'] = location_for(hiera_version) if hiera_version | |
48 | |
49 if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)} | |
50 # If we're using a Puppet gem on Windows which handles its own win32-xxx gem | |
51 # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). | |
52 gems['win32-dir'] = ['<= 0.4.9', require: false] | |
53 gems['win32-eventlog'] = ['<= 0.6.5', require: false] | |
54 gems['win32-process'] = ['<= 0.7.5', require: false] | |
55 gems['win32-security'] = ['<= 0.2.5', require: false] | |
56 gems['win32-service'] = ['0.8.8', require: false] | |
26
58d1818c2ded
Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents:
0
diff
changeset
|
57 end |
58d1818c2ded
Update MySQL module (which adds "staging" module)
IBBoard <dev@ibboard.co.uk>
parents:
0
diff
changeset
|
58 |
244 | 59 gems.each do |gem_name, gem_params| |
60 gem gem_name, *gem_params | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
61 end |
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
62 |
244 | 63 # Evaluate Gemfile.local and ~/.gemfile if they exist |
64 extra_gemfiles = [ | |
65 "#{__FILE__}.local", | |
66 File.join(Dir.home, '.gemfile'), | |
67 ] | |
68 | |
69 extra_gemfiles.each do |gemfile| | |
70 if File.file?(gemfile) && File.readable?(gemfile) | |
71 eval(File.read(gemfile), binding) | |
72 end | |
0
956e484adc12
Initial public release of Puppet configs
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
73 end |
244 | 74 # vim: syntax=ruby |