Skip to content

Commit e82e56f

Browse files
committed
Install released puppet and facter gems
Allow `PUPPET_GEM_VERSION` to be passed as an environment variable, including the source: $ export PUPPET_GEM_VERSION="source:https://rubygems-puppetcore.puppet.com#~> 8.0" $ export BUNDLE_RUBYGEMS___PUPPETCORE__PUPPET__COM=forge-key:XXX $ bundle install $ bundle exec puppet --version 8.13.1
1 parent 8ad4f48 commit e82e56f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/unit_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ jobs:
1414

1515
Released:
1616
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
17+
secrets: inherit

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org'
33
def location_for(place_or_version, fake_version = nil)
44
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
55
file_url_regex = %r{\Afile:\/\/(?<path>.*)}
6+
source_url_regex = %r{\Asource:(?<url>[^#]*)(#(?<version>.*))?}
67

78
if place_or_version && (git_url = place_or_version.match(git_url_regex))
89
[fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact
910
elsif place_or_version && (file_url = place_or_version.match(file_url_regex))
1011
['>= 0', { path: File.expand_path(file_url[:path]), require: false }]
12+
elsif place_or_version && (source = place_or_version.match(source_url_regex))
13+
[source[:version], { require: false, source: source[:url] }]
1114
else
1215
[place_or_version, { require: false }]
1316
end

0 commit comments

Comments
 (0)