adoptium / ci-jenkins-pipelines

jenkins pipeline build scripts
Apache License 2.0
19 stars 70 forks source link

Move dockerRegistry tag patch into with dockerRegistry section to avoid build break with image tags #1083

Closed andrew-m-leonard closed 2 months ago

andrew-m-leonard commented 2 months ago

Fixes: https://github.com/adoptium/ci-jenkins-pipelines/issues/1082

A patch to fix the above build break, fix https://github.com/adoptium/ci-jenkins-pipelines/pull/1076 was added to handle dockerRegistry and adding a local tage of DOCKER_IMAGE, but does not correctly handle the fact the image may have a :tag or @digest

This patch moves that code to the dockerRegistry section, but the proper fix for https://github.com/adoptium/ci-jenkins-pipelines/pull/1076 should be to not do that tagging, but instead probably to use context.docker.withRegistry when necessary to run the container, but that needs proper investigation.

github-actions[bot] commented 2 months ago

Thank you for creating a pull request!

Please check out the information below if you have not made a pull request here before (or if you need a reminder how things work).

Code Quality and Contributing Guidelines

If you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before.

Tests

Github actions will run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation.

In order to run the advanced pipeline tests (executing a set of mock pipelines), it requires an admin to post run tests on this PR. If you are not an admin, please ask for one's attention in #infrastructure on Slack or ping one here. To run full set of tests, use "run tests"; a subset of tests on specific jdk version, use "run tests quick 11,21"

andrew-m-leonard commented 2 months ago

run tests

andrew-m-leonard commented 2 months ago

@mahdipub fyi

andrew-m-leonard commented 2 months ago

I'm struggling a little to understand the fix here so just to clarify - is this fix going to work on the assumption that things from a separate registry (i.e. with DOCKER_REGISTRY in the pipeline config) won't have a tag or is it more subtle than that?

Correct, the problem @mahdipub was trying to fix was when using a dockerRegistry rather than the default dockerhub, so for his purpose the fix only needs to be when DOCKER_REGISTRY is used

andrew-m-leonard commented 2 months ago

The proper fix I suspect is to re-work the pipeline code to correctly use the docker context with a specific Registry

andrew-m-leonard commented 2 months ago

I'm struggling a little to understand the fix here so just to clarify - is this fix going to work on the assumption that things from a separate registry (i.e. with DOCKER_REGISTRY in the pipeline config) won't have a tag or is it more subtle than that?

If they have a tag, then you are right that fix will not work either..... but I am guessing @mahdipub semeru does not use "tags" ?

eclipse-temurin-bot commented 2 months ago

 PR TESTER RESULT 

✅ All pipelines passed! ✅