v4.4.30
Release notes
Changes
- Fixed
scpreparebuildpipelineforgitlabandscpreparebuildpipelineforgithubnot checking out the branch the pipeline runs for. The runner checks out the commit in a detached-head-state, and the generated branch-namepipeline_<timestamp>which was used in that case does not tell the versioning which branch is built, so a repository had to check the branch out itself in its pipeline-configuration before calling the command. Doing that withgit checkout -bmakes the whole job fail withfatal: a branch named '<branch>' already existsas soon as the runner reuses the build-directory of a previous pipeline-run of the same branch, because agit cleanremoves untracked files but no branch-refs. The branch-name is taken from the environment-variable of the ci-system now (CI_COMMIT_REF_NAMEfor gitlab respectivelyGITHUB_REF_NAMEfor github) and the branch is checked out withgit checkout -B, which also works if the branch already exists, so the pipeline-configuration of a repository must not do this anymore - Fixed that the build of a docker-codeunit did not log in to the registries which are defined for the machine before it started
docker buildx build. The base-image of aDockerfileis resolved by buildkit and not by ScriptCollection, so a base-image which comes from a registry that is not publicly readable made the build fail withfailed to resolve source metadata [...] 401 Unauthorizedalthough the credentials were configured. The same gap existed indocker_pull, which relied on the login being done by whatever resolved the address of the image before. Both log in themselves now - Added that every image which a repository declares in
.ScriptCollection/OCIImages/ImageDefinition.csvis passed to the build of a docker-codeunit as the build-argumentimage_<imagename in lowercase>, whose value is the address with tag the image has to be taken from on this machine (the same name under which an image is available to the local test-services). ADockerfilehas to declare its base-image with it (ARG image_debianfollowed byFROM ${image_debian}) instead of writing a registry-address into itsFROM-line, because an address inside theDockerfileis resolved by buildkit and therefore neither uses the custom registry which is preferred on this machine nor the fallback-registry of the repository - The machine-wide credentials-file
~/.ScriptCollection/GlobalCache/RegistryCredentials.csvis mounted read-only into the build-container of a locally started container-build now (to/Workspace/ScriptCollectionConfiguration/RegistryCredentials.csv), analogous to the image-registries-file. Until now a build in a container could only use a registry which requires authentication when its credentials were declared as environment-variables, because the configuration-folder inside the container belongs to the container-user. The credentials of both sources are still used together - Fixed the documentation of the configuration-folder claiming that everything which accesses a registry logs in beforehand, which was not true for the image-build and for
docker_pull, and that the credentials-file is never exposed to the build-container
Migration
Every repository which has a docker-codeunit whose Dockerfile takes its base-image from a registry has to replace the address in the FROM-line by the build-argument of that image, for example ARG image_debian and FROM ${image_debian} for an image which is declared as Debian in .ScriptCollection/OCIImages/ImageDefinition.csv. A FROM-line which keeps a literal address still builds, but it ignores the custom registry of the machine as well as the fallback-registry.