Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #!/opt/puppetlabs/puppet/bin/ruby
  2. require 'json'
  3. require 'socket'
  4.  
  5. compile_master = Socket.gethostname
  6. environmentpath = ARGV[0]
  7. environment = ARGV[1]
  8.  
  9. # Get the short SHA1 commit ID from the control repository.
  10. r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
  11. commit_id_short = JSON.parse(File.read(r10k_deploy_file_path))['signature'][0...11]
  12.  
  13. # Show the compiling master, environment name, and short commit ID.
  14. puts "#{compile_master}-#{environment}-#{commit_id_short}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement