Index: Jenkins/FullBuild
===================================================================
--- Jenkins/FullBuild	(revision bd502053d936b332513b3ec4e728cd3f922f4432)
+++ Jenkins/FullBuild	(revision cc5544af1672991cab57aef3286b724dec645050)
@@ -106,5 +106,5 @@
 
 	if(result.result != 'SUCCESS') {
-		sh("wget -q -O - http://localhost:8084/jenkins/job/Cforall/job/master/${result.number}/consoleText")
+		sh("wget -q -O - https://cforall.uwaterloo.ca/jenkins/job/Cforall/job/master/${result.number}/consoleText")
 		error(result.result)
 	}
Index: Jenkins/Promote
===================================================================
--- Jenkins/Promote	(revision cc5544af1672991cab57aef3286b724dec645050)
+++ Jenkins/Promote	(revision cc5544af1672991cab57aef3286b724dec645050)
@@ -0,0 +1,76 @@
+#!groovy
+
+node {
+	// Globals
+	BuildDir   = pwd tmp: true
+	SrcDir     = pwd tmp: false
+	RemoteRepo = 'git@github.com:cforall/cforall.git'
+	ArchiveUrl = 'https://cforall.uwaterloo.ca/jenkins/job/Cforall_Distribute_Ref/lastSuccessfulBuild/artifact/*zip*/archive.zip'
+
+	// Local variables
+	def err = null
+	def log_needed = false
+
+	currentBuild.result = "SUCCESS"
+
+	//Wrap build to add timestamp to command line
+	wrap([$class: 'TimestamperBuildWrapper']) {
+
+		PrepRepo();
+
+		def name = GetArchive();
+
+		PushRepo(name);
+	}
+
+}
+
+def GetTarName() {
+	def files = findFiles(glob: 'archive/cfa-cc-*.tar.gz')
+	echo "found: ${files[0].name}"
+	return files[0].name - '.tar.gz';
+}
+
+def PrepRepo() {
+	stage('Clone') { // for display purposes
+		dir (BuildDir) {
+		    sh 'rm -rf *'
+			sshagent (credentials: ['github_key_jun1']) {
+				sh "git clone --bare ${RemoteRepo} repo"
+			}
+			dir ('repo') {
+				sh "mkdir .git"
+				sh "mv * .git"
+				sh "git init"
+			}
+		}
+	}
+}
+
+def GetArchive() {
+	def tarball
+	stage('Unzip') { // for display purposes
+		dir (BuildDir) {
+			sh "wget -q ${ArchiveUrl}"
+			sh "unzip archive.zip"
+			tarball = GetTarName();
+			sh "tar -xzf archive/${tarball}.tar.gz"
+			sh "mv ${tarball}/* repo/."
+		}
+	}
+
+	return tarball
+}
+
+def PushRepo(name) {
+	stage('Push') { // for display purposes
+		dir ("${BuildDir}/repo") {
+			sh "git add -A"
+			sh "git status"
+			sh "git diff-index --quiet HEAD || git commit -m 'Push from build machine: ${name}'"
+			sshagent (credentials: ['github_key_jun1']) {
+				sh "git push origin master"
+			}
+		}
+	}
+}
Index: Jenkins/tools.groovy
===================================================================
--- Jenkins/tools.groovy	(revision bd502053d936b332513b3ec4e728cd3f922f4432)
+++ Jenkins/tools.groovy	(revision cc5544af1672991cab57aef3286b724dec645050)
@@ -61,10 +61,5 @@
 }
 
-PrevGitOldRef = ''
-PrevGitNewRef = ''
-def GitLogMessage(String oldRef = '', String newRef = '') {
-	if (!oldRef) { if(!PrevGitOldRef) { return "\nERROR retrieveing current git information!\n"  } else { oldRef = PrevGitOldRef } }
-	if (!newRef) { if(!PrevGitNewRef) { return "\nERROR retrieveing previous git information!\n" } else { newRef = PrevGitNewRef } }
-
+def ConstructGitLogMessage(String oldRef, String newRef) {
 	def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
 	def revList = SplitLines( revText )
@@ -86,7 +81,4 @@
 	gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')
 	gitDiff = gitDiff.replace('[m', '</span>')
-
-	PrevGitOldRef = oldRef
-	PrevGitNewRef = newRef
 
 	return """
@@ -116,3 +108,19 @@
 }
 
+EmailMessage = ''
+def GitLogMessage(String oldRef = '', String newRef = '') {
+	if(!EmailMessage) {
+		if (!oldRef) { return "\nERROR retrieveing current git information!\n"  }
+		if (!newRef) { return "\nERROR retrieveing previous git information!\n" }
+
+		echo "Constructing new git message"
+
+		EmailMessage = ConstructGitLogMessage(oldRef, newRef)
+	}
+	else {
+		echo "Reusing previously constructed message"
+	}
+	return EmailMessage;
+}
+
 return this;
