Hrm. So for a GitHub Organisation PR, the $JOB_NAME will be github-org/project/PR-XX.
First of all, that's an invalid tag name. But let's assume we can make it sane by removing the {{/}}s.
But more importantly, when that PR lands to master, the tag on the docker image will still be for PR-XX even though it will actually now be the new current image being used for master (I think). But it's not tagged for master on that project, it's tagged for PR-XX on that project.
Granted when (the locally written script for) garbage cleanup removes that PR-XX image because PR-XX is closed, the master branch build will build a new (identical) docker image to replace the just removed one. But that's an extra build that shouldn't be necessary.
That said, it's probably still better than simply using the "oldest built" garbage collection mechanism that is being suggested in this ticket.
Also, allanlewis_youview, you didn't respond to my other concern:
Doesn't deleting all of the Jenkins produced hashy type tags mean that Jenkins won't be able to find an image to re-use for a future run of a job where the Dockerfile has not changed?
Hrm. So for a GitHub Organisation PR, the $JOB_NAME will be github-org/project/PR-XX.
First of all, that's an invalid tag name. But let's assume we can make it sane by removing the {{/}}s.
But more importantly, when that PR lands to master, the tag on the docker image will still be for PR-XX even though it will actually now be the new current image being used for master (I think). But it's not tagged for master on that project, it's tagged for PR-XX on that project.
Granted when (the locally written script for) garbage cleanup removes that PR-XX image because PR-XX is closed, the master branch build will build a new (identical) docker image to replace the just removed one. But that's an extra build that shouldn't be necessary.
That said, it's probably still better than simply using the "oldest built" garbage collection mechanism that is being suggested in this ticket.
Also, allanlewis_youview, you didn't respond to my other concern: