git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authormail_redacted_for_web 2018-05-08 10:43:35 -0700
committermail_redacted_for_web 2018-05-08 10:43:35 -0700
commitaaa85a0e03ed4036c6421426479e4cf66affb2dd (patch)
tree3e1e6f61cad009ab5800d1d47b54f1b740ecb177 /scripts
parent78662f908d0269805333079429188d05fdcd5637 (diff)
parente5189b5515ea376a7e9763d3ad70e66cf116f24c (diff)
downloadcontrol-repo-template-aaa85a0e03ed4036c6421426479e4cf66affb2dd.tar.bz2
Merge pull request #57 from natemccurdy/config_version
Config Version Improvements
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/code_manager_config_version.rb3
-rwxr-xr-xscripts/config_version.rb5
2 files changed, 5 insertions, 3 deletions
diff --git a/scripts/code_manager_config_version.rb b/scripts/code_manager_config_version.rb
index 1ef62af..beacabc 100755
--- a/scripts/code_manager_config_version.rb
+++ b/scripts/code_manager_config_version.rb
@@ -6,7 +6,8 @@ environmentpath = ARGV[0]
environment = ARGV[1]
# Get the hostname of the Puppet master compiling the catalog.
-compiling_master = Socket.gethostname
+# Sometimes the hostname is the fqdn, so we'll take the first segment.
+compiling_master = Socket.gethostname.split('.').first
# Get the path to the Code Manager deployment info file.
r10k_deploy_file_path = File.join(environmentpath, environment, '.r10k-deploy.json')
diff --git a/scripts/config_version.rb b/scripts/config_version.rb
index 5aade34..3de7104 100755
--- a/scripts/config_version.rb
+++ b/scripts/config_version.rb
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#!/opt/puppetlabs/puppet/bin/ruby
begin
require 'rugged'
require 'socket'
@@ -10,7 +10,8 @@ else
environment = ARGV[1]
# Get the hostname of the Puppet master compiling the catalog.
- compiling_master = Socket.gethostname
+ # Sometimes the hostname is the fqdn, so we'll take the first segment.
+ compiling_master = Socket.gethostname.split('.').first
# Get the path to the environment being compiled.
repo = Rugged::Repository.discover(File.join(environmentpath, environment))