Update config_version to read r10k_deploy.json file

Update config_version.sh to read the r10k_deploy.json file if it
exists.  If it does not exist it will fall back to the existing
logic
This commit is contained in:
Nick Walker 2015-12-14 16:28:13 -08:00
parent b8d4980f86
commit 56d0908db2
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,9 @@
require 'json'
environmentpath = ARGV[0]
environment = ARGV[1]
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
#output the sha1 from the control-repo
puts JSON.parse(File.read(r10k_deploy_file_path))['signature']

View File

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
if [ -e /opt/puppetlabs/server/pe_version ] if [ -e $1/$2/.r10k-deploy.json ]
then
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/code_manager_config_version.rb $1 $2
elif [ -e /opt/puppetlabs/server/pe_version ]
then then
/opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2 /opt/puppetlabs/puppet/bin/ruby $1/$2/scripts/config_version.rb $1 $2
else else