debian-mirror-gitlab/qa/Dockerfile

73 lines
2.7 KiB
Docker
Raw Normal View History

2022-07-23 23:45:48 +05:30
ARG DOCKER_VERSION=20.10.14
2023-01-13 00:05:48 +05:30
ARG CHROME_VERSION=106
2023-03-04 22:38:38 +05:30
ARG QA_BUILD_TARGET=ee
2023-03-17 16:20:25 +05:30
ARG RUBY_VERSION=3.0
2022-07-23 23:45:48 +05:30
2023-03-04 22:38:38 +05:30
FROM registry.gitlab.com/gitlab-org/gitlab-build-images/debian-bullseye-ruby-${RUBY_VERSION}:bundler-2.3-git-2.36-lfs-2.9-chrome-${CHROME_VERSION}-docker-${DOCKER_VERSION}-gcloud-383-kubectl-1.23 AS foss
2020-04-08 14:13:33 +05:30
LABEL maintainer="GitLab Quality Department <quality@gitlab.com>"
2020-06-23 00:09:42 +05:30
2022-07-23 23:45:48 +05:30
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-08-13 15:12:31 +05:30
# Use webdriver preinstalled in the base image
ENV WD_INSTALL_DIR=/usr/local/bin
2017-08-17 22:00:37 +05:30
2018-12-13 13:39:08 +05:30
##
2022-07-16 23:28:13 +05:30
# Install system libs
2017-08-17 22:00:37 +05:30
#
2023-04-23 21:23:45 +05:30
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-09-04 01:27:46 +05:30
2023-06-20 00:43:36 +05:30
##
# Install 1Password CLI
#
RUN wget -P /tmp/ https://downloads.1password.com/linux/debian/$(dpkg --print-architecture)/stable/1password-cli-$(dpkg --print-architecture)-latest.deb
RUN dpkg -i /tmp/1password-cli-$(dpkg --print-architecture)-latest.deb
RUN op --version
2021-04-17 20:07:23 +05:30
##
# 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-10-12 21:52:04 +05:30
WORKDIR /home/gitlab/qa
2021-09-30 23:02:18 +05:30
2022-07-16 23:28:13 +05:30
##
2021-09-30 23:02:18 +05:30
# Install qa dependencies or fetch from cache if unchanged
2022-07-16 23:28:13 +05:30
#
2019-10-12 21:52:04 +05:30
COPY ./qa/Gemfile* /home/gitlab/qa/
2022-07-23 23:45:48 +05:30
RUN bundle config set --local without development \
&& bundle install --retry=3
2021-09-30 23:02:18 +05:30
2019-10-12 21:52:04 +05:30
COPY ./config/initializers/0_inject_enterprise_edition_module.rb /home/gitlab/config/initializers/
2022-07-23 23:45:48 +05:30
COPY ./config/feature_flags /home/gitlab/config/feature_flags
2022-08-13 15:12:31 +05:30
COPY ./config/bundler_setup.rb /home/gitlab/config/
2022-03-02 08:16:31 +05:30
COPY ./lib/gitlab_edition.rb /home/gitlab/lib/
2019-12-21 20:55:43 +05:30
COPY ./lib/gitlab/utils.rb /home/gitlab/lib/gitlab/
COPY ./INSTALLATION_TYPE ./VERSION /home/gitlab/
2021-09-30 23:02:18 +05:30
2019-10-12 21:52:04 +05:30
COPY ./qa /home/gitlab/qa
2017-08-17 22:00:37 +05:30
ENTRYPOINT ["bin/test"]
2022-08-13 15:12:31 +05:30
2023-03-04 22:38:38 +05:30
# Add ee files when passing the parameter: `--build-arg QA_BUILD_TARGET=ee`
FROM foss as ee
# 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)
ONBUILD COPY VERSION ./ee/app/models/license.r[b] /home/gitlab/ee/app/models/
ONBUILD COPY VERSION ./ee/config/feature_flag[s] /home/gitlab/ee/config/feature_flags/
# Add JH files when passing the parameter: `--build-arg QA_BUILD_TARGET=jhqa`
FROM ee AS jhqa
2022-08-13 15:12:31 +05:30
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