Merge remote-tracking branch 'origin/CI-pushDH' into integration_2025_w42 (!3691)
[CI] Ensure multi-arch DockerHub Push after successful image build This merge request improves the CI script to ensure that the DockerHub-Push stage executes whenever: - All Image Build stages succeed & - doBuild is true & - The event is a PUSH This behavior ensures that Docker images are published whenever the image build stages succeed, regardless of any failures in the Image Test stages. Jetson ARM64/V8 and AMD64 images will now be published on DockerHub under the same tag (develop or WEEK_TAG) to provide multi-architecture images.
This commit is contained in:
@@ -267,6 +267,23 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage ("DockerHub-Push") {
|
||||||
|
when { expression {doBuild && "PUSH".equals(env.gitlabActionType)} }
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
failure {
|
||||||
|
script {
|
||||||
|
echo "Push to Docker-Hub KO"
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
failingStages += '\n * RAN-DockerHub-Push'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
stage ("Image Test Processes") {
|
stage ("Image Test Processes") {
|
||||||
when { expression {doBuild} }
|
when { expression {doBuild} }
|
||||||
parallel {
|
parallel {
|
||||||
@@ -756,23 +773,6 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage ("DockerHub-Push") {
|
|
||||||
when { expression {doBuild && "PUSH".equals(env.gitlabActionType)} }
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
triggerSlaveJob ('RAN-DockerHub-Push', 'DockerHub-Push')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
failure {
|
|
||||||
script {
|
|
||||||
echo "Push to Docker-Hub KO"
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
failingStages += '\n * RAN-DockerHub-Push'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
post {
|
post {
|
||||||
success {
|
success {
|
||||||
|
|||||||
@@ -84,12 +84,9 @@ 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 pull --quiet ${OAI_Registry}/${item}:develop-${WEEK_SHA}"
|
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop || true"
|
||||||
sh "docker image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:develop"
|
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 image tag ${OAI_Registry}/${item}:develop-${WEEK_SHA} ${DH_Account}/${item}:${WEEK_TAG}"
|
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 push --quiet ${DH_Account}/${item}:${WEEK_TAG}"
|
|
||||||
sh "docker push --quiet ${DH_Account}/${item}:develop"
|
|
||||||
sh "docker rmi ${DH_Account}/${item}:${WEEK_TAG} ${DH_Account}/${item}:develop ${OAI_Registry}/${item}:develop-${WEEK_SHA}"
|
|
||||||
}
|
}
|
||||||
// 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"
|
||||||
|
|||||||
Reference in New Issue
Block a user