fix: container scanning when using multi target docker images
Fixes issues seen as in https://gitlab.developers.cam.ac.uk/uis/devops/iam/authentication/shibboleth/attributes-proxy/-/jobs/1860027
There are two things in this MR:
- I noticed that with our current approach,
CI_ARTIFACT_REGISTRY_REPOSITORY
was actually not present ingl-auto-build-variables.env
because https://gitlab.com/gitlab-org/cluster-integration/auto-build-image/-/blob/master/src/build.sh?ref_type=heads#L51 overwrites all content in the file -
container_scanning
hasdependencies
set to[]
(https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Jobs/Container-Scanning.gitlab-ci.yml#L45), meaning thatgl-auto-build-variables.env
would not be loaded. We need to overwrite this and explicitly tell it to depend on thebuild
job.
This MR fixes both issues.