-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script to display supported setfiles
This is a simple implementation to parse a metadata.json and output all supported beaker setfiles. The output will contain our default hostname/domain: ```console $ bundle exec setfiles Skipping EOL operating system Debian 10 Skipping EOL operating system Ubuntu 18.04 BEAKER_SETFILE="centos9-64{hostname=centos9-64-puppet8.example.com}" BEAKER_SETFILE="centos9-64{hostname=centos9-64-puppet7.example.com}" BEAKER_SETFILE="debian11-64{hostname=debian11-64-puppet8.example.com}" BEAKER_SETFILE="debian11-64{hostname=debian11-64-puppet7.example.com}" BEAKER_SETFILE="ubuntu2004-64{hostname=ubuntu2004-64-puppet8.example.com}" BEAKER_SETFILE="ubuntu2004-64{hostname=ubuntu2004-64-puppet7.example.com}" ```
- Loading branch information
1 parent
290a543
commit b6f0faa
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# frozen_string_literal: true | ||
|
||
require 'json' | ||
require 'puppet_metadata' | ||
|
||
filename = ARGV[0] | ||
filename = 'metadata.json' if filename.nil? || filename.empty? | ||
|
||
begin | ||
metadata = PuppetMetadata.read(filename) | ||
rescue StandardError => e | ||
warn "Failed to read #{filename}: #{e}" | ||
exit 2 | ||
end | ||
|
||
options = { | ||
beaker_pidfile_workaround: false, | ||
domain: 'example.com', | ||
minimum_major_puppet_version: nil, | ||
beaker_fact: nil, | ||
beaker_hosts: nil, | ||
} | ||
|
||
metadata.github_actions(options).outputs[:puppet_beaker_test_matrix].each do |os| | ||
puts "BEAKER_SETFILE=\"#{os[:env]['BEAKER_SETFILE']}\"" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters