Commit d73c2618 authored by Raphael Defosseux's avatar Raphael Defosseux

Merge branch 'add-rhel8-build-ci' into 'develop'

Add rhel8 build ci

See merge request oai/cn5g/oai-cn5g-amf!16
parents 56f8113e abb5bc4f
......@@ -39,7 +39,7 @@ case "$OS_DISTRO" in
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt-get"; CMAKE="cmake" ;;
esac
IS_CONTAINER=`egrep -c "docker|kubepods|podman|runc-buildah|libpod" /proc/self/cgroup`
IS_CONTAINER=`egrep -c "docker|kubepods|podman|buildah|libpod" /proc/self/cgroup || true`
if [ $IS_CONTAINER -eq 0 ]
then
......
This diff is collapsed.
......@@ -109,6 +109,15 @@ class HtmlReport():
buildSummary += ' <td><a href="' + self.git_url + '">' + self.git_url + '</a></td>\n'
buildSummary += ' </tr>\n'
if self.git_pull_request:
buildSummary += ' <tr>\n'
buildSummary += ' <td bgcolor="lightcyan" > <span class="glyphicon glyphicon-log-out"></span> Source Branch</td>\n'
buildSummary += ' <td><a href="TEMPLATE_MERGE_REQUEST_LINK">TEMPLATE_MERGE_REQUEST_LINK</a></td>\n'
buildSummary += ' </tr>\n'
buildSummary += ' <tr>\n'
buildSummary += ' <td bgcolor="lightcyan" > <span class="glyphicon glyphicon-header"></span> Merge Request Title</td>\n'
buildSummary += ' <td>TEMPLATE_MERGE_REQUEST_TEMPLATE</td>\n'
buildSummary += ' </tr>\n'
buildSummary += ' <tr>\n'
buildSummary += ' <td bgcolor="lightcyan" > <span class="glyphicon glyphicon-log-out"></span> Source Branch</td>\n'
buildSummary += ' <td>' + self.git_src_branch + '</td>\n'
buildSummary += ' </tr>\n'
......@@ -153,7 +162,7 @@ class HtmlReport():
buildSummaryDone = True
with open(cwd + '/ds_tester_results_oai_cn5g.html', 'r') as originalEpcReport:
for line in originalEpcReport:
result = re.search('DS Tester Summary', line)
result = re.search('Deployment Summary', line)
if (result is not None) and buildSummaryDone:
newEpcReport.write(buildSummary)
buildSummaryDone = False
......@@ -366,12 +375,13 @@ class HtmlReport():
self.file.write(' </div>\n')
def buildSummaryHeader(self):
self.file.write(' <h2>Docker Image Build Summary</h2>\n')
self.file.write(' <h2>Docker / Podman Image Build Summary</h2>\n')
self.file.write(' <table class="table-bordered" width = "100%" align = "center" border = "1">\n')
self.file.write(' <tr bgcolor="#33CCFF" >\n')
self.file.write(' <th>Stage Name</th>\n')
self.file.write(' <th>Image Kind</th>\n')
self.file.write(' <th>OAI AMF cNF</th>\n')
self.file.write(' <th>OAI AMF <font color="Gold">Ubuntu18</font> Image</th>\n')
self.file.write(' <th>OAI AMF <font color="Gold">RHEL8</font> Image</th>\n')
self.file.write(' </tr>\n')
def buildSummaryFooter(self):
......@@ -401,13 +411,14 @@ class HtmlReport():
def analyze_docker_build_git_part(self, nfType):
if nfType != 'AMF':
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
logFileName = 'amf_docker_image_build.log'
self.file.write(' <td>Builder Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
status = False
section_start_pattern = 'git config --global http'
......@@ -447,13 +458,15 @@ class HtmlReport():
def analyze_install_log(self, nfType):
if nfType != 'AMF':
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
logFileName = 'amf_docker_image_build.log'
self.file.write(' <td>Builder Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
status = False
section_start_pattern = 'build_amf --install-deps --force'
......@@ -563,15 +576,16 @@ class HtmlReport():
if nfType != 'AMF':
if imageKind:
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
if nfType == 'AMF':
logFileName = 'amf_docker_image_build.log'
if imageKind:
self.file.write(' <td>Builder Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
status = False
if nfType == 'AMF':
......@@ -612,15 +626,15 @@ class HtmlReport():
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
return
if nfType == 'AMF':
logFileName = 'amf_docker_image_build.log'
if imageKind:
self.file.write(' <td>Builder Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
nb_errors = 0
nb_warnings = 0
if os.path.isfile(cwd + '/archives/' + logFileName):
if nfType == 'AMF':
section_start_pattern = 'build_amf --clean --Verbose --build-type Release --jobs'
......@@ -675,13 +689,15 @@ class HtmlReport():
def analyze_copy_log(self, nfType):
if nfType != 'AMF':
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
logFileName = 'amf_docker_image_build.log'
self.file.write(' <td>Target Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
section_start_pattern = 'FROM ubuntu:bionic as oai-amf$'
section_end_pattern = 'WORKDIR /openair-amf/etc'
......@@ -719,16 +735,21 @@ class HtmlReport():
def analyze_copy_conf_tool_log(self, nfType):
if nfType != 'AMF':
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
logFileName = 'amf_docker_image_build.log'
self.file.write(' <td>Target Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
section_start_pattern = 'WORKDIR /openair-amf/etc'
if variant == 'docker':
section_end_pattern = 'Successfully tagged oai-amf'
else:
section_end_pattern = 'COMMIT oai-amf:'
section_status = False
status = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
......@@ -764,19 +785,24 @@ class HtmlReport():
if nfType != 'AMF':
if imageKind:
self.file.write(' <td>N/A</td>\n')
self.file.write(' <td>Wrong NF Type for this Report</td>\n')
self.file.write(' <td colspan="2">Wrong NF Type for this Report</td>\n')
return
if nfType == 'AMF':
logFileName = 'amf_docker_image_build.log'
if imageKind:
self.file.write(' <td>Target Image</td>\n')
cwd = os.getcwd()
variants = ['docker', 'podman']
for variant in variants:
logFileName = 'amf_' + variant + '_image_build.log'
if os.path.isfile(cwd + '/archives/' + logFileName):
if nfType == 'AMF':
if variant == 'docker':
section_start_pattern = 'Successfully tagged oai-amf'
section_end_pattern = 'OAI-AMF DOCKER IMAGE BUILD'
else:
section_start_pattern = 'COMMIT oai-amf:'
section_end_pattern = 'OAI-AMF PODMAN RHEL8 IMAGE BUILD'
section_status = False
status = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
......@@ -786,7 +812,7 @@ class HtmlReport():
section_status = True
result = re.search(section_end_pattern, line)
if result is not None:
section_status = False
section_status = True
if section_status:
if nfType == 'AMF':
if self.git_pull_request:
......
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