Merge branch 'qa-sub-image' into 'master'

Move custom images to separate major component directories

See merge request gitlab-org/gitlab-build-images!528
This commit is contained in:
Stan Hu 2022-05-03 17:51:30 +00:00
commit bc50d18201
4 changed files with 51 additions and 29 deletions

40
.gitlab/ci/e2e.images.yml Normal file
View file

@ -0,0 +1,40 @@
# Used by gitlab e2e tests and other qa related tasks
# Base image used by QA framework unit tests and other jobs not requiring full toolset
.e2e-base:
variables:
DEBIAN: bullseye
GIT: '2.33'
RUBY: '2.7'
BUNDLER: '2.3'
CHROME: '99'
# Image used for running full e2e test suite
.e2e-full:
variables:
LFS: '2.9'
GCLOUD: '383'
KUBECTL: '1.23'
DOCKER: '20.10.14'
e2e-base test:
extends:
- .e2e-base
- .test_custom
e2e-base push:
extends:
- .e2e-base
- .build_and_deploy_custom
needs: ["e2e-base test"]
e2e-full test:
extends:
- .e2e-base
- .e2e-full
- .test_custom
e2e-full push:
extends:
- .e2e-base
- .e2e-full
- .build_and_deploy_custom
needs: ["e2e-full test"]

View file

@ -1,23 +0,0 @@
# Used by gitlab e2e tests and other qa related tasks
.qa:
variables:
DEBIAN: bullseye
LFS: '2.9'
GIT: '2.33'
RUBY: '2.7'
BUNDLER: '2.3'
CHROME: '99'
GCLOUD: '383'
KUBECTL: '1.23'
DOCKER: '20.10.14'
qa test:
extends:
- .qa
- .test_custom
qa push:
extends:
- .qa
- .build_and_deploy_custom
needs: ["qa test"]

View file

@ -268,7 +268,6 @@ function print_kubectl_args() {
function parse_arguments() {
printf -- "-f Dockerfile.custom "
# Mapping between sources of architectures
# - arch: a current image architecture (or uname -m if matching host, but can be different)
# - apk --print-arch: a alpine architecture for installed packages
@ -337,14 +336,15 @@ function generate_command() {
function build_custom_if_needed() {
build_image_path=$(get_image_path)
build_image_tag=$(get_image_tag)
echo "Building image $build_image_tag"
full_image_name="$build_image_path:$build_image_tag"
echo "Building image $full_image_name"
docker_command=$(generate_command $@ --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from="$full_image_name" -t "$full_image_name")
echo "Docker command:"
printf "\t%s" "$docker_command"
eval $docker_command
printf "\n\nSUCCESS - Successfully built:\n\t%s" "$build_image_tag"
printf "\n\nSUCCESS - Successfully built:\n\t%s" "$full_image_name"
echo ""
}
build_custom_if_needed $@

View file

@ -1,5 +1,5 @@
PATH_TOOLS=()
TAG_TOOLS=(DEBIAN RUBY BUNDLER GOLANG GIT LFS CHROME NODE YARN POSTGRESQL GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER GCLOUD KUBECTL)
PATH_TOOLS=(DEBIAN RUBY GOLANG NODE POSTGRESQL)
TAG_TOOLS=(BUNDLER GIT LFS CHROME YARN GRAPHICSMAGICK PGBOUNCER BAZELISK DOCKER GCLOUD KUBECTL)
function get_image_path() {
local path
@ -25,5 +25,10 @@ function get_image_tag() {
tag="${tag}-${tool,,}-${!tool}"
fi
done
echo "${tag:1}"
if [[ -n "$tag" ]]; then
echo "${tag:1}"
else
echo "latest"
fi
}