Skip to content

Commit ef0e4c0

Browse files
committed
(PA-7366) 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 To test against nightly puppet, we need the twingate token. To test against released puppet, we need to the puppetcore token.
1 parent 8ad4f48 commit ef0e4c0

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

.github/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
jobs:
1010
daily_unit_tests_with_nightly_puppet_gem:
1111
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
12+
secrets: inherit
1213

1314
notify-via-slack:
1415
name: Notify workflow conclusion via Slack

.github/workflows/unit_tests.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
Nightly:
1313
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_nightly_puppet_gem.yaml@main"
14+
secrets: inherit
1415

1516
Released:
1617
uses: "puppetlabs/phoenix-github-actions/.github/workflows/unit_tests_with_released_puppet_gem.yaml@main"
18+
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)