diff --git a/.travis.yml b/.travis.yml index 86e150fe..552d7596 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,8 @@ matrix: # Build with latest ruby - rvm: 2.5 env: RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="5.5.8" + - rvm: 2.5 + env: RUBOCOP_TEST="true" RSPEC_TEST="true" PUPPET_VERSIONS="6.18.0" # Puppet supports ruby 2.0 and 2.1 with Puppet 4.x, but build with more recent versions too - rvm: 2.3 env: RUBOCOP_TEST="false" RSPEC_TEST="true" PUPPET_VERSIONS="4.10.10" diff --git a/lib/octocatalog-diff/catalog-util/command.rb b/lib/octocatalog-diff/catalog-util/command.rb index edb8c398..4e00c8e0 100644 --- a/lib/octocatalog-diff/catalog-util/command.rb +++ b/lib/octocatalog-diff/catalog-util/command.rb @@ -22,6 +22,8 @@ def initialize(options = {}, logger = nil) @node = options[:node] raise ArgumentError, 'Node must be specified to compile catalog' if @node.nil? || !@node.is_a?(String) + @puppet_version = options[:puppet_version] + # To be initialized on-demand @puppet_argv = nil @puppet_binary = nil @@ -56,7 +58,12 @@ def setup # Node to compile cmdline = [] - cmdline.concat ['master', '--compile', Shellwords.escape(@node)] + + if Gem::Version.new(@puppet_version) >= Gem::Version.new('6.0.0') + cmdline.concat ['catalog', 'compile', Shellwords.escape(@node)] + else + cmdline.concat ['master', '--compile', Shellwords.escape(@node)] + end # storeconfigs? if @options[:storeconfigs] @@ -95,7 +102,7 @@ def setup --no-daemonize --no-ca --color=false - --config_version="/bin/echo catalogscript" + --config_version="/usr/bin/true" ) # Add environment - only make this variable if preserve_environments is used. diff --git a/lib/octocatalog-diff/catalog/computed.rb b/lib/octocatalog-diff/catalog/computed.rb index a4d00fd8..d463d794 100644 --- a/lib/octocatalog-diff/catalog/computed.rb +++ b/lib/octocatalog-diff/catalog/computed.rb @@ -145,6 +145,7 @@ def puppet_command_obj compilation_dir: @builddir.tempdir, parser: @options.fetch(:parser, :default), puppet_binary: @puppet_binary, + puppet_version: puppet_version, fact_file: @builddir.fact_file, dir: @builddir.tempdir, enc: @builddir.enc