git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/scripts/config_version.sh
blob: 7ccd2f4be02bd2a194f6f0f420f42f009c1a3baf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

if [ $# -ne 2 -o ! -d "$1" -o ! -d "$1/$2" ]; then
  echo "usage: $0 <environmentpath> <environment>" >&2
  exit 1
fi

ruby=ruby
script="$1/$2/scripts/config_version.rb"

if [ -x /opt/puppetlabs/puppet/bin/ruby ]; then
  ruby=/opt/puppetlabs/puppet/bin/ruby
fi

if [ -e $1/$2/.r10k-deploy.json ]; then
  script="$1/$2/scripts/code_manager_config_version.rb"
fi

"${ruby}" "${script}" "$1" "$2"