Commit e96a9e2a authored by Raphael Defosseux's avatar Raphael Defosseux

fix(ci): handling the case of build on `develop` fails

 * Instead of removing previous `develop` image, rename it and keep it in case of failure
   - will allow other NF CI runs to be tested with this "old" version
 * Little typo in the HTML generation
Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent 623f1df1
......@@ -183,6 +183,7 @@ pipeline {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
try {
myShCmd('docker image tag oai-amf:develop oai-amf:develop-previous', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker image rm oai-amf:develop', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
} catch (Exception e) {
echo "Maybe a previous build went wrong"
......@@ -221,9 +222,12 @@ pipeline {
}
}
success {
myShCmd('docker image rm oai-amf:develop-previous || true', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
sh "echo 'OAI-AMF DOCKER IMAGE BUILD: OK' >> archives/amf_docker_image_build.log"
}
unsuccessful {
myShCmd('docker image tag oai-amf:develop-previous oai-amf:develop || true', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker image rm oai-amf:develop-previous || true', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
sh "echo 'OAI-AMF DOCKER IMAGE BUILD: KO' >> archives/amf_docker_image_build.log"
}
}
......@@ -238,6 +242,7 @@ pipeline {
// Currently this pipeline only runs for pushes to `develop` branch
// First clean image registry
try {
myShCmd('sudo podman image tag oai-amf:develop oai-amf:develop-previous || true', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman image rm oai-amf:develop || true', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
} catch (Exception e) {
echo "Maybe a previous build went wrong"
......@@ -271,9 +276,12 @@ pipeline {
}
}
success {
myShCmd('sudo podman image rm oai-amf:develop-previous || true', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
sh "echo 'OAI-AMF PODMAN RHEL8 IMAGE BUILD: OK' >> archives/amf_podman_image_build.log"
}
unsuccessful {
myShCmd('sudo podman image tag oai-amf:develop-previous oai-amf:develop || true', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman image rm oai-amf:develop-previous || true', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
sh "echo 'OAI-AMF PODMAN RHEL8 IMAGE BUILD: KO' >> archives/amf_podman_image_build.log"
}
}
......
......@@ -474,7 +474,7 @@ class HtmlReport():
base_image = False
with open(cwd + '/archives/' + logFileName, 'r') as logfile:
for line in logfile:
result = re.search('FROM oai-amf-base', line)
result = re.search('FROM oai-amf-base:latest', line)
if result is not None:
base_image = True
result = re.search(section_start_pattern, line)
......
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