Commit 76d32382 authored by Raphael Defosseux's avatar Raphael Defosseux

feat(ci): using the full CI temp tag for test stages, cleaner

Signed-off-by: default avatarRaphael Defosseux <raphael.defosseux@openairinterface.org>
parent f0f75ef5
...@@ -142,10 +142,9 @@ pipeline { ...@@ -142,10 +142,9 @@ pipeline {
shortenShaOne = shortenShaOne.trim() shortenShaOne = shortenShaOne.trim()
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}" sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "sleep 10" sh "sleep 10"
amf_tag = "ci-tmp" amf_tag = 'ci-tmp-pr-' + env.gitlabMergeRequestIid + '-' + shortenShaOne
rhel_amf_tag = 'ci-tmp-pr-' + env.gitlabMergeRequestIid + '-' + shortenShaOne
amf_branch = env.gitlabSourceBranch amf_branch = env.gitlabSourceBranch
echo "MR TAG is ${rhel_amf_tag}" echo "MR TAG is ${amf_tag}"
} else { } else {
echo "======== THIS IS A PUSH REQUEST ========" echo "======== THIS IS A PUSH REQUEST ========"
echo "Git Branch is ${GIT_BRANCH}" echo "Git Branch is ${GIT_BRANCH}"
...@@ -208,10 +207,6 @@ pipeline { ...@@ -208,10 +207,6 @@ pipeline {
// If not satisfactory, we can remove it. // If not satisfactory, we can remove it.
myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-amf:' + amf_tag, rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('python3 ./ci-scripts/flatten_image.py --tag oai-amf:' + amf_tag, rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
myShCmd('docker image ls >> archives/amf_docker_image_build.log', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker image ls >> archives/amf_docker_image_build.log', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
// We will keep also the TMP image in U18 case.
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('docker image tag oai-amf:' + amf_tag + ' oai-amf:' + rhel_amf_tag, rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
}
} }
} }
} }
...@@ -259,9 +254,6 @@ pipeline { ...@@ -259,9 +254,6 @@ pipeline {
myShCmd('sudo cp /etc/rhsm/ca/*.pem ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo cp /etc/rhsm/ca/*.pem ./rhsm-ca', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman build --no-cache --squash --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.rhel8 --format docker . > archives/amf_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman build --no-cache --squash --target oai-amf --tag oai-amf:' + amf_tag + ' --file docker/Dockerfile.amf.rhel8 --format docker . > archives/amf_podman_image_build.log 2>&1', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
myShCmd('sudo podman image ls >> archives/amf_podman_image_build.log', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host) myShCmd('sudo podman image ls >> archives/amf_podman_image_build.log', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('sudo podman image tag oai-amf:' + amf_tag + ' oai-amf:' + rhel_amf_tag, rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
}
} }
} }
} }
...@@ -560,21 +552,6 @@ pipeline { ...@@ -560,21 +552,6 @@ pipeline {
// Remove CI Base image tag // Remove CI Base image tag
myShCmd('docker rmi oai-amf-base:latest', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker rmi oai-amf-base:latest', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
} }
// Removing temporary / intermediate images
try {
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('docker image rm --force oai-amf:ci-tmp', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
}
} catch (Exception e) {
echo "We failed to delete the OAI-AMF temp image"
}
try {
if ("MERGE".equals(env.gitlabActionType)) {
myShCmd('sudo podman image rm oai-amf:ci-tmp', rem_rhel_host_flag, rem_rhel_host_user, rem_rhel_host)
}
} catch (Exception e) {
echo "We failed to delete the OAI-AMF temp image"
}
try { try {
myShCmd('docker image prune --force', rem_u18_host_flag, rem_u18_host_user, rem_u18_host) myShCmd('docker image prune --force', rem_u18_host_flag, rem_u18_host_user, rem_u18_host)
} catch (Exception e) { } catch (Exception e) {
......
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