diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..e5d7e1a47 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +--- +name: Build site on PR + +on: + pull_request: {} + push: + branches: + - master + +permissions: + contents: read + +jobs: + rake_checks: + name: Rake Checks + runs-on: ubuntu-24.04 + steps: + # needs fetch-depth because the packaging dem reads old git tags + - name: Checkout current PR + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Ruby version 3.3 + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.3 + bundler-cache: true + - name: Display Ruby environment + run: bundle env + - name: Validate code + run: bundle exec rake generate + env: + DEBUG_PUPPET_DOCS_RAKEFILE: 1 diff --git a/Rakefile b/Rakefile index 9bd70818e..11574409a 100644 --- a/Rakefile +++ b/Rakefile @@ -43,7 +43,7 @@ def jekyll(command = 'build', source = SOURCE_DIR, destination = OUTPUT_DIR, *ar puts about_verbose_mode if ENV['DEBUG_PUPPET_DOCS_RAKEFILE'] - verbose_mode = '--verbose | tee puppet-docs-build.log' + verbose_mode = '--verbose --trace | tee puppet-docs-build.log' end amended_config = "#{SOURCE_DIR}/_config_amended.yml" diff --git a/config.ru b/config.ru index 09799896e..eab5576de 100644 --- a/config.ru +++ b/config.ru @@ -30,7 +30,11 @@ module Rack return entity_not_found(path_info) end - def list_path + def list_path(env = @env, path = @path, path_info = @path_info, script_name = @script_name) + @env = env + @path = path + @path_info = path_info + @script_name = script_name @stat = ::File.stat(@path) if @stat.readable? @@ -41,7 +45,7 @@ module Rack @env['PATH_INFO'] = @env['PATH_INFO'].sub(/\/?$/, '/index.html') return @app.call(@env) else - return list_directory + return list_directory(@path_info, @path, @script_name) end end else @@ -49,7 +53,7 @@ module Rack end rescue Errno::ENOENT, Errno::ELOOP - return entity_not_found + return entity_not_found(@path_info) end end diff --git a/lib/puppet_references.rb b/lib/puppet_references.rb index f6a9f60bd..e65cfe99d 100644 --- a/lib/puppet_references.rb +++ b/lib/puppet_references.rb @@ -37,7 +37,7 @@ def self.build_puppet_references(commit) PuppetReferences::Puppet::Functions ] config = PuppetReferences::Config.read - repo = PuppetReferences::Repo.new('puppet', PUPPET_DIR, nil, config['puppet']['repo']) + repo = PuppetReferences::Repo.new('openvox', PUPPET_DIR, nil, config['puppet']['repo']) real_commit = repo.checkout(commit) repo.update_bundle build_from_list_of_classes(references, real_commit) diff --git a/lib/puppet_references/puppet/functions.rb b/lib/puppet_references/puppet/functions.rb index 90c61f7c5..700f5d469 100644 --- a/lib/puppet_references/puppet/functions.rb +++ b/lib/puppet_references/puppet/functions.rb @@ -44,7 +44,7 @@ def build_variant(filename, preferred_version = 'ruby4x') # BTW, I learned this trick from the Facter reference that the agent team made for us back in the day. template_binding = OpenStruct.new({ functions: functions }).instance_eval {binding} - body = ERB.new(File.read(TEMPLATE_FILE), nil, '-').result(template_binding) + body = ERB.new(File.read(TEMPLATE_FILE), trim_mode: '-').result(template_binding) # This substitution could potentially make things a bit brittle, but it has to be done because the jump # From H2s to H4s is causing issues with the DITA-OT, which sees this as a rule violation. If it # Does become an issue, we should return to this and figure out a better way to generate the functions doc. diff --git a/lib/puppet_references/puppet/type.rb b/lib/puppet_references/puppet/type.rb index 4db526efc..5c7052d01 100644 --- a/lib/puppet_references/puppet/type.rb +++ b/lib/puppet_references/puppet/type.rb @@ -8,7 +8,7 @@ module Puppet class Type < PuppetReferences::Reference TYPEDOCS_SCRIPT = PuppetReferences::BASE_DIR + 'lib/puppet_references/quarantine/get_typedocs.rb' TEMPLATE_FILE = Pathname.new(File.expand_path(__FILE__)).dirname + 'type_template.erb' - TEMPLATE = ERB.new(TEMPLATE_FILE.read, nil, '-') + TEMPLATE = ERB.new(TEMPLATE_FILE.read, trim_mode: '-') PREAMBLE_FILE = Pathname.new(File.expand_path(__FILE__)).dirname + 'type_preamble.md' PREAMBLE = PREAMBLE_FILE.read diff --git a/lib/puppet_references/repo.rb b/lib/puppet_references/repo.rb index 28073f093..93a664012 100644 --- a/lib/puppet_references/repo.rb +++ b/lib/puppet_references/repo.rb @@ -13,7 +13,7 @@ def initialize(name, directory, sources = nil, config = nil) if sources @sources = [sources].flatten else - @sources = ["git@github.com:puppetlabs/#{@name}.git"] + @sources = ["git@github.com:openvoxproject/#{@name}.git"] end @main_source = @sources[0] unless Dir.exist?(@directory + '.git') || @config['skip_download'] @@ -52,4 +52,4 @@ def update_bundle end end -end \ No newline at end of file +end diff --git a/source/_config.yml b/source/_config.yml index 2d3d4c6c7..e717c7f37 100644 --- a/source/_config.yml +++ b/source/_config.yml @@ -34,7 +34,7 @@ defaultnav: # subdirectory: documentation # A subdirectory within the remote repository that contains the documentation files that we'll build and mount at the specified url. externalsources: /mcollective: - repo: git@github.com:choria-legacy/marionette-collective.git + repo: https://github.com/choria-legacy/marionette-collective.git commit: origin/2.12.x subdirectory: website @@ -92,7 +92,7 @@ documents: version: "latest" nav: ./_puppetdb_nav.html external_source: - repo: git://github.com/puppetlabs/puppetdb.git + repo: https://github.com/puppetlabs/puppetdb.git commit: doc-latest subdirectory: documentation hide: true @@ -101,7 +101,7 @@ documents: version: "7" nav: ./_puppetdb_nav.html external_source: - repo: git://github.com/puppetlabs/puppetdb.git + repo: https://github.com/puppetlabs/puppetdb.git commit: doc-7.y subdirectory: documentation hide: true @@ -110,7 +110,7 @@ documents: version: "6" nav: ./_puppetdb_nav.html external_source: - repo: git://github.com/puppetlabs/puppetdb.git + repo: https://github.com/puppetlabs/puppetdb.git commit: doc-6.y subdirectory: documentation hide: true @@ -119,7 +119,7 @@ documents: version: "5.2" nav: ./_puppetdb_nav.html external_source: - repo: git://github.com/puppetlabs/puppetdb.git + repo: https://github.com/puppetlabs/puppetdb.git commit: doc-5.2 subdirectory: documentation hide: true @@ -129,7 +129,7 @@ documents: doc: puppet version: "latest" nav: ./_puppet_toc.html - + # Puppet 6.y /puppet/6.y: doc: puppet diff --git a/source/_plugins/change_baseurl.rb b/source/_plugins/change_baseurl.rb index 9843d5d26..b9a13f402 100644 --- a/source/_plugins/change_baseurl.rb +++ b/source/_plugins/change_baseurl.rb @@ -27,7 +27,7 @@ def render(context) (@url, @old_baseurl, @new_baseurl) = @args.map{|arg| if arg =~ @var_regex - Liquid::Variable.new(arg).render(context) + context[arg] else arg.sub(/\A['"]/, '').sub(/['"]\Z/, '') end diff --git a/source/facter/index.md b/source/facter/index.md deleted file mode 100644 index a6f791451..000000000 --- a/source/facter/index.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -layout: default -title: "Facter 3.1: Documentation index" ---- - -Facter is Puppet's cross-platform system profiling library. It discovers and reports per-node facts, which are available in your Puppet manifests as variables. - -* [The list of core facts](./core_facts.html) lists and describes every built-in fact that ships with Facter. -* [The custom fact reference](./fact_overview.html) serves as an example-driven primer and quick reference for fact authors. -* [The custom facts walkthrough](./custom_facts.html) explains in detail how to write and distribute your own custom or external facts. -* [The Facter release notes](./release_notes.html) document Facter's history.