Commit 0d191702 authored by Raphael Defosseux's avatar Raphael Defosseux

CI: comment message is now in all HTML reports

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@eurecom.fr>
parent cc62375d
......@@ -104,6 +104,7 @@ pipeline {
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
sh "git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG"
sh "zip -r -qq localZip.zip ."
// Running astyle options on all C/H files in the repository
......@@ -600,6 +601,10 @@ OAI CI Team''',
replyTo: 'no-reply@openairinterface.org',
subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
to: env.gitlabUserEmail
if (fileExists('.git/CI_COMMIT_MSG')) {
sh "rm -f .git/CI_COMMIT_MSG"
}
}
}
success {
......
......@@ -121,6 +121,7 @@ git config user.email "jenkins@openairinterface.org"
git config user.name "OAI Jenkins"
git checkout -f $SOURCE_COMMIT_ID
git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG
git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI"
......
......@@ -59,6 +59,7 @@ import re # reg
import pexpect # pexpect
import time # sleep
import os
import subprocess
import xml.etree.ElementTree as ET
import logging
import datetime
......@@ -1962,7 +1963,16 @@ class SSHConnection():
self.command('cp /opt/ltebox/var/log/xGwLog.0 .', '\$', 5)
self.command('zip spgw.log.zip xGwLog.0', '\$', 60)
self.close()
def RetrieveSystemVersion(self):
if self.eNBIPAddress == 'none':
self.eNBOsVersion = 'Ubuntu 16.04.5 LTS'
self.eNBKernelVersion = '4.15.0-45-generic'
self.eNBUhdVersion = '3.13.0.1-0'
self.eNBCpuNb = '4'
self.eNBCpuModel = 'Intel(R) Core(TM) i5-6200U'
self.eNBCpuMHz = '2399.996 MHz'
return
if self.eNBIPAddress == '' or self.eNBUserName == '' or self.eNBPassword == '':
Usage()
sys.exit('Insufficient Parameter')
......@@ -2055,6 +2065,16 @@ class SSHConnection():
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-tag"></span> Commit ID </td>\n')
self.htmlFile.write(' <td>' + self.eNBCommitID + '</td>\n')
self.htmlFile.write(' </tr>\n')
if self.eNB_AllowMerge != '':
commit_message = subprocess.check_output("git log -n1 --pretty=format:\"%s\" " + self.eNBCommitID, shell=True, universal_newlines=True)
commit_message = commit_message.strip()
self.htmlFile.write(' <tr>\n')
if (self.eNB_AllowMerge):
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-comment"></span> Source Commit Message </td>\n')
else:
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-comment"></span> Commit Message </td>\n')
self.htmlFile.write(' <td>' + commit_message + '</td>\n')
self.htmlFile.write(' </tr>\n')
if (self.eNB_AllowMerge):
self.htmlFile.write(' <tr>\n')
self.htmlFile.write(' <td bgcolor = "lightcyan" > <span class="glyphicon glyphicon-log-in"></span> Target Branch </td>\n')
......
......@@ -363,6 +363,14 @@ function report_build {
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-tag\"></span> Commit ID</td>" >> ./build_results.html
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " <tr>" >> ./build_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-comment\"></span> Commit Message</td>" >> ./build_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " <td>$MSG</td>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
fi
fi
if [ $MR_TRIG -eq 1 ]
then
......@@ -374,6 +382,14 @@ function report_build {
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-tag\"></span> Source Commit ID</td>" >> ./build_results.html
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " <tr>" >> ./build_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-comment\"></span> Source Commit Message</td>" >> ./build_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " <td>$MSG</td>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
fi
echo " <tr>" >> ./build_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-log-in\"></span> Target Branch</td>" >> ./build_results.html
echo " <td>$TARGET_BRANCH</td>" >> ./build_results.html
......
......@@ -139,6 +139,14 @@ function report_test {
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-tag\"></span> Commit ID</td>" >> ./test_simulator_results.html
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " <tr>" >> ./test_simulator_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-comment\"></span> Commit Message</td>" >> ./test_simulator_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " <td>$MSG</td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
fi
fi
if [ $MR_TRIG -eq 1 ]
then
......@@ -150,6 +158,14 @@ function report_test {
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-tag\"></span> Source Commit ID</td>" >> ./test_simulator_results.html
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
if [ -e .git/CI_COMMIT_MSG ]
then
echo " <tr>" >> ./test_simulator_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-comment\"></span> Commit Message</td>" >> ./test_simulator_results.html
MSG=`cat .git/CI_COMMIT_MSG`
echo " <td>$MSG</td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
fi
echo " <tr>" >> ./test_simulator_results.html
echo " <td bgcolor = \"lightcyan\" > <span class=\"glyphicon glyphicon-log-in\"></span> Target Branch</td>" >> ./test_simulator_results.html
echo " <td>$TARGET_BRANCH</td>" >> ./test_simulator_results.html
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment