Commit bca59396 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/ci-fix-dockerhub-push' into integration_2025_w43 (!3710)

[CI] Update the Push to DockerHub Stage

This MR addresses two cases:

1. Error Handling: Ensures subsequent Image Test Processes stages
   continue to run even if the preceding Push to DockerHub stage fails
   (applies when the condition is PUSH event and doBuild is true).

2. Introduces conditional logic to correctly handle multi-architecture
   images: Images built for both AMD64 and Jetson ARMv8 (oai-gnb,
   oai-nr-ue, oai-nr-cuup) use docker buildx imagetools for push to
   DockerHub.

All other AMD64 images are pushed using standard Docker commands.

Related MR !3691
parents 7c18dfd9 61b54178
...@@ -271,14 +271,15 @@ pipeline { ...@@ -271,14 +271,15 @@ pipeline {
when { expression {doBuild && "PUSH".equals(env.gitlabActionType)} } when { expression {doBuild && "PUSH".equals(env.gitlabActionType)} }
steps { steps {
script { script {
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push') triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push')
} }
} }
}
post { post {
failure { failure {
script { script {
echo "Push to Docker-Hub KO" echo "Push to Docker-Hub KO"
currentBuild.result = 'FAILURE'
failingStages += '\n * RAN-DockerHub-Push' failingStages += '\n * RAN-DockerHub-Push'
} }
} }
......
...@@ -84,9 +84,20 @@ pipeline { ...@@ -84,9 +84,20 @@ pipeline {
sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1" sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1"
sh "docker login -u oaicicd -p oaicicd ${OAI_Registry} > /dev/null 2>&1" sh "docker login -u oaicicd -p oaicicd ${OAI_Registry} > /dev/null 2>&1"
listOfImages.eachWithIndex { item, iindex -> listOfImages.eachWithIndex { item, iindex ->
if (["oai-gnb", "oai-nr-ue", "oai-nr-cuup"].contains(item)) {
// For images built on AMD64 and ARMv8 Jetson
echo "Pushing image '${item}' for both AMD64 and ARM64 architectures with tags: ${WEEK_TAG} and develop"
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop || true" sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop || true"
sh "docker buildx imagetools create --tag ${DH_Account}/${item}:${WEEK_TAG} ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}" sh "docker buildx imagetools create --tag ${DH_Account}/${item}:${WEEK_TAG} ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}"
sh "docker buildx imagetools create --tag ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}" sh "docker buildx imagetools create --tag ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}"
} else {
sh "docker pull --quiet ${OAI_Registry}/${item}:develop-${WEEK_SHA}"
sh "docker image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:develop"
sh "docker image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:${WEEK_TAG}"
sh "docker push --quiet ${DH_Account}/${item}:develop"
sh "docker push --quiet ${DH_Account}/${item}:${WEEK_TAG}"
}
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:develop-${WEEK_SHA} || true"
} }
// Proxy is not following the same pattern. // Proxy is not following the same pattern.
sh "docker image tag proxy:develop ${DH_Account}/proxy:develop" sh "docker image tag proxy:develop ${DH_Account}/proxy:develop"
......
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