Move puppet version to puppet.sh

This commit is contained in:
Kevin Paulisse 2017-04-01 14:00:00 -04:00
Родитель e9b1b37944
Коммит 5daa1e7461
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 66DA91D838188671
4 изменённых файлов: 18 добавлений и 17 удалений

Просмотреть файл

@ -48,8 +48,4 @@ This is an explanation of the [existing scripts supplied by octocatalog-diff](/s
- [`puppet.sh`](/scripts/puppet)
Runs puppet (with additional command line arguments), generally used to compile a catalog.
- [`puppet-version.sh`](/scripts/puppet-version)
Runs `puppet --version` to determine the version of Puppet being used.
Runs puppet (with additional command line arguments), generally used to compile a catalog or determine the Puppet version.

Просмотреть файл

@ -18,9 +18,11 @@ module OctocatalogDiff
raise ArgumentError, 'Puppet binary was not supplied' if puppet.nil?
raise Errno::ENOENT, "Puppet binary #{puppet} doesn't exist" unless File.file?(puppet)
logger = options[:logger] || Logger.new(StringIO.new)
sr_opts = {
logger: Logger.new(StringIO.new),
default_script: 'puppet-version/puppet-version.sh',
logger: logger,
default_script: 'puppet/puppet.sh',
override_script_path: options[:override_script_path]
}
@ -29,6 +31,7 @@ module OctocatalogDiff
sr_run_opts = {
:working_dir => File.dirname(puppet),
:pass_env_vars => options[:pass_env_vars],
:argv => '--version',
'OCD_PUPPET_BINARY' => puppet
}

Просмотреть файл

@ -1,10 +0,0 @@
#!/bin/bash
# Script to determine the Puppet version.
if [ -z "$OCD_PUPPET_BINARY" ]; then
echo "Error: PUPPET_BINARY must be set"
exit 255
fi
"$OCD_PUPPET_BINARY" --version

12
scripts/puppet/puppet.sh Normal file
Просмотреть файл

@ -0,0 +1,12 @@
#!/bin/bash
# Script to run Puppet. The default implementation here is simply to pass
# through the command line arguments (which are likely to be numerous when
# compiling a catalog).
if [ -z "$OCD_PUPPET_BINARY" ]; then
echo "Error: PUPPET_BINARY must be set"
exit 255
fi
"$OCD_PUPPET_BINARY" "$@"