2022-06-08 08:08:46 -04:00
ARG DOCKER_VERSION=20.10.14
2022-08-02 14:12:15 -04:00
ARG CHROME_VERSION=103
2022-07-07 17:09:22 -04:00
ARG QA_BUILD_TARGET=qa
2022-06-08 08:08:46 -04:00
2022-07-07 17:09:22 -04:00
FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-2.7:bundler-2.3-git-2.33-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 AS qa
2020-03-16 17:09:21 -04:00
LABEL maintainer="GitLab Quality Department <quality@gitlab.com>"
2020-06-01 17:08:09 -04:00
2022-05-23 08:08:41 -04:00
ENV DEBIAN_FRONTEND="noninteractive"
# Override config path to make sure local config doesn't override it when building image locally
ENV BUNDLE_APP_CONFIG=/home/gitlab/.bundle
2022-07-04 20:09:38 -04:00
# Use webdriver preinstalled in the base image
ENV WD_INSTALL_DIR=/usr/local/bin
2021-07-07 08:08:23 -04:00
2018-10-15 02:10:26 -04:00
##
2022-05-12 05:08:08 -04:00
# Install system libs
2017-05-24 07:56:31 -04:00
#
2022-05-12 05:08:08 -04:00
RUN apt-get update; \
apt-get install -y xvfb unzip; \
apt-get -yq autoremove; \
apt-get clean -yqq; \
rm -rf /var/lib/apt/lists/*
2021-05-21 02:11:06 -04:00
2021-02-23 07:10:56 -05:00
##
# Install root certificate
#
RUN mkdir -p /usr/share/ca-certificates/gitlab
ADD ./qa/tls_certificates/authority/ca.crt /usr/share/ca-certificates/gitlab/
RUN echo 'gitlab/ca.crt' >> /etc/ca-certificates.conf
RUN chmod -R 644 /usr/share/ca-certificates/gitlab && update-ca-certificates
2019-08-06 08:50:52 -04:00
WORKDIR /home/gitlab/qa
2021-07-13 20:09:11 -04:00
2022-05-12 05:08:08 -04:00
##
2021-07-19 02:08:44 -04:00
# Install qa dependencies or fetch from cache if unchanged
2022-05-12 05:08:08 -04:00
#
2019-08-06 08:50:52 -04:00
COPY ./qa/Gemfile* /home/gitlab/qa/
2022-05-23 08:08:41 -04:00
RUN bundle config set --local without development \
&& bundle install --retry=3
2021-07-19 02:08:44 -04:00
2019-08-06 08:50:52 -04:00
COPY ./config/initializers/0_inject_enterprise_edition_module.rb /home/gitlab/config/initializers/
2019-10-03 20:06:03 -04:00
# Copy VERSION to ensure the COPY succeeds to copy at least one file since ee/app/models/license.rb isn't present in FOSS
# The [b] part makes ./ee/app/models/license.r[b] a pattern that is allowed to return no files (which is the case in FOSS)
2019-08-22 12:06:05 -04:00
COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/
2022-07-07 14:09:40 -04:00
COPY VERSION ./ee/config/feature_flag[s] /home/gitlab/ee/config/feature_flags/
2022-06-07 20:08:12 -04:00
COPY ./config/feature_flags /home/gitlab/config/feature_flags
2022-07-07 14:09:40 -04:00
COPY ./config/bundler_setup.rb /home/gitlab/config/
2021-12-20 16:10:56 -05:00
COPY ./lib/gitlab_edition.rb /home/gitlab/lib/
2019-10-10 14:06:00 -04:00
COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/
2019-10-03 20:06:03 -04:00
COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/
2021-07-13 20:09:11 -04:00
2019-08-06 08:50:52 -04:00
COPY ./qa /home/gitlab/qa
2017-03-16 09:04:43 -04:00
2017-02-20 06:45:04 -05:00
ENTRYPOINT ["bin/test"]
2022-07-07 17:09:22 -04:00
# Add JH files when pass the parameter: `--build-arg QA_BUILD_TARGET=jhqa`
FROM qa AS jhqa
ONBUILD COPY ./jh/qa /home/gitlab/jh/qa
ONBUILD COPY ./jh/lib /home/gitlab/jh/lib
ONBUILD COPY ./jh/config/feature_flags /home/gitlab/jh/config/feature_flags
FROM $QA_BUILD_TARGET