git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/scripts/config_version.rb
diff options
context:
space:
mode:
authormail_redacted_for_web 2015-08-03 17:05:06 -0700
committermail_redacted_for_web 2015-08-03 17:05:06 -0700
commitf5cb1fa75796327cefe8054efeab855c143ef2e3 (patch)
tree03d15ad055772110183abc70efec2df89645d716 /scripts/config_version.rb
parent437433ff44cd77915a4a7b1d61d7aa624c44b41a (diff)
downloadcontrol-repo-template-f5cb1fa75796327cefe8054efeab855c143ef2e3.tar.bz2
Update config_version to use a script that does not require git
The config_version now uses a script that will do one of two things: 1. call config_version.rb which uses rugged to find the information about the latest commit if PE is on version 2015.2 or newer 2. make a call to git if the PE version is less than 2015.2
Diffstat (limited to 'scripts/config_version.rb')
-rw-r--r--scripts/config_version.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/config_version.rb b/scripts/config_version.rb
new file mode 100644
index 0000000..52f32c5
--- /dev/null
+++ b/scripts/config_version.rb
@@ -0,0 +1,17 @@
+require 'rugged'
+
+environmentpath = ARGV[0]
+environment = ARGV[1]
+
+repo = Rugged::Repository.discover(File.join(environmentpath, environment))
+head = repo.head
+
+#sha1 hash of the newest commit
+head_sha = head.target_id
+
+#the commit message associated the newest commit
+commit = repo.lookup(head_sha)
+
+#add something to find the remote url
+
+puts head_sha