Commit 61b54178 authored by Shubhika Garg's avatar Shubhika Garg Committed by Shubhika Garg

ci: Update and implement conditional DockerHub push

  - Push both AMD64 & ARMv8 Jetson images together for images built on both using `docker buildx imagetools`
  - Use standard 'docker pull and push' for images built only on AMD64.
parent b0ab5e87
...@@ -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 ->
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop || true" if (["oai-gnb", "oai-nr-ue", "oai-nr-cuup"].contains(item)) {
sh "docker buildx imagetools create --tag ${DH_Account}/${item}:${WEEK_TAG} ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}" // For images built on AMD64 and ARMv8 Jetson
sh "docker buildx imagetools create --tag ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:armv8_develop-${WEEK_SHA} ${OAI_Registry}/${item}:develop-${WEEK_SHA}" 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 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}"
} 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