Skip to content

Commit aaa85a0

Browse files
authored
Merge pull request #57 from natemccurdy/config_version
Config Version Improvements
2 parents 78662f9 + e5189b5 commit aaa85a0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

scripts/code_manager_config_version.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
environment = ARGV[1]
77

88
# Get the hostname of the Puppet master compiling the catalog.
9-
compiling_master = Socket.gethostname
9+
# Sometimes the hostname is the fqdn, so we'll take the first segment.
10+
compiling_master = Socket.gethostname.split('.').first
1011

1112
# Get the path to the Code Manager deployment info file.
1213
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')

scripts/config_version.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env ruby
1+
#!/opt/puppetlabs/puppet/bin/ruby
22
begin
33
require 'rugged'
44
require 'socket'
@@ -10,7 +10,8 @@
1010
environment = ARGV[1]
1111

1212
# Get the hostname of the Puppet master compiling the catalog.
13-
compiling_master = Socket.gethostname
13+
# Sometimes the hostname is the fqdn, so we'll take the first segment.
14+
compiling_master = Socket.gethostname.split('.').first
1415

1516
# Get the path to the environment being compiled.
1617
repo = Rugged::Repository.discover(File.join(environmentpath, environment))

0 commit comments

Comments
 (0)