Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,13 @@ jobs:
${{ matrix.cfg.extra }}
bundle install --jobs 4 --retry 3

# CAT-2840: puppet 8.x's gemspec pins puppet-resource_api ~> 1.9, unsatisfiable by main (2.x)
- name: Rubocop
continue-on-error: ${{ matrix.cfg.puppet_version == '8' }}
run: |
bundle exec rake rubocop

- name: Run tests
continue-on-error: ${{ matrix.cfg.puppet_version == '8' }}
run: |
bundle exec rake spec
22 changes: 17 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
source 'https://rubygems.org'

gemsource_puppetcore = if ENV['PUPPET_GEM_VERSION'].to_s.match?(/\A~>\s*9/) &&
ENV['PUPPET_FORGE_TOKEN'] && !ENV['PUPPET_FORGE_TOKEN'].empty?
'https://rubygems-puppetcore.puppet.com'
else
# CAT-2962
gemsource_public_opt_out = Bundler.settings['gemsource.public']
gemsource_puppetcore = if gemsource_public_opt_out
ENV['GEM_SOURCE_PUPPETCORE'] || 'https://rubygems.org'
else
'https://rubygems-puppetcore.puppet.com'
end

unless ENV['PUPPET_FORGE_TOKEN'] || ENV['BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM'] ||
Bundler.settings['gemsource.airgapped'] || gemsource_public_opt_out
Bundler.ui.warn <<~WARNING
No puppetcore credentials detected.
On an airgapped install, run `bundle config set gemsource.airgapped true` to suppress this warning.
To use public gems instead, run `bundle config set gemsource.public true`.
WARNING
end

git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }

# Specify your gem's dependencies in puppet-resource_api.gemspec
Expand Down Expand Up @@ -66,4 +76,6 @@ def location_for(place_or_version, fake_version = nil, opts = {})
end
end

gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'], nil, { source: gemsource_puppetcore })
source gemsource_puppetcore do
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'])
end
Loading