Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73334


Change subject: Generate Puppet config_version from short SHA1 of HEAD
......................................................................

Generate Puppet config_version from short SHA1 of HEAD

This patch tells Puppet to generate the configuration version by capturing the
output of puppet/extra/config-version. That script gets the short SHA1 hash of
HEAD for MediaWiki-Vagrant, if it is available. If it is not, the script
defaults to the current UNIX timestamp, UTC.

Puppet uses the configuration version to label its log output. By setting it
to the SHA1 of HEAD, it should be easier to correlate Puppet logs to specific
changes. For details, see the Puppet manual: <http://docs.puppetlabs.com/
references/latest/configuration.html#configversion>

Change-Id: Ia11d7cbd686078ccbaca524377addbe1645cf754
---
M Vagrantfile
A puppet/extra/config-version
2 files changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/34/73334/1

diff --git a/Vagrantfile b/Vagrantfile
index 3b87391..1017eec 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -83,6 +83,7 @@
             '--node_terminus', 'exec',
             '--external_nodes', '/vagrant/puppet/extra/puppet-classifier',
             '--verbose',
+            '--config_version', '/vagrant/puppet/extra/config-version',
             '--logdest', '/vagrant/logs/puppet.log',
             '--logdest', 'console',
         ]
diff --git a/puppet/extra/config-version b/puppet/extra/config-version
new file mode 100755
index 0000000..fdb2e56
--- /dev/null
+++ b/puppet/extra/config-version
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Prior to each Puppet run, Puppet will invoke this script to determine the
+# configuration version. The script will try to get the short SHA1 hash of HEAD
+# if available and the current timestamp (UTC) otherwise.
+#
+# For more information, see the Puppet manual:
+# 
<http://docs.puppetlabs.com/references/latest/configuration.html#configversion>
+#
+{ git --git-dir="/vagrant/.git" rev-parse --short HEAD || date -u +%s ; } 
2>/dev/null

-- 
To view, visit https://gerrit.wikimedia.org/r/73334
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia11d7cbd686078ccbaca524377addbe1645cf754
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to