2018-04-07 09:13:41 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-04-07 09:34:07 +00:00
|
|
|
if [ $# -ne 2 -o ! -d "$1" -o ! -d "$1/$2" ]; then
|
|
|
|
echo "usage: $0 <environmentpath> <environment>" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-04-07 09:13:41 +00:00
|
|
|
ruby=ruby
|
|
|
|
script="$1/$2/scripts/config_version.rb"
|
|
|
|
|
|
|
|
if [ -x /opt/puppetlabs/puppet/bin/ruby ]; then
|
|
|
|
ruby=/opt/puppetlabs/puppet/bin/ruby
|
2017-07-05 23:55:39 +00:00
|
|
|
fi
|
2018-04-07 09:13:41 +00:00
|
|
|
|
|
|
|
if [ -e $1/$2/.r10k-deploy.json ]; then
|
|
|
|
script="$1/$2/scripts/code_manager_config_version.rb"
|
|
|
|
fi
|
|
|
|
|
|
|
|
"${ruby}" "${script}" "$1" "$2"
|