summaryrefslogtreecommitdiff
path: root/qa/gdk/Dockerfile
blob: ed8f3f317ebe12b7d834d567ca23ec1b8c7942e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM registry.gitlab.com/gitlab-org/gitlab-development-kit/asdf-bootstrapped-gdk-installed-gitlab-e2e:ml-create-image-for-gitlab-qa-tests

ENV CHROME_DRIVER_VERSION="107.0.5304.62"
ENV CHROME_VERSION="107.0.5304.87-1"
ENV CHROME_DEB="google-chrome-stable_${CHROME_VERSION}_amd64.deb"
ENV CHROME_URL="https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-build-images/packages/generic/google-chrome-stable/${CHROME_VERSION}/${CHROME_DEB}"

WORKDIR /home/gdk/gdk

COPY --chown=gdk qa/gdk/gdk.yml .

RUN cat gdk.yml && \
    gdk update && \
    gdk restart && \
    ./support/test_url http://gdk.test:3000 && \
    gdk stop && sleep 5 && \
    GDK_KILL_CONFIRM=true gdk kill && \
    ps -ef && \
    cd gitlab && git reset --hard && \
    sudo rm -rf "$HOME/gdk/gitaly/_build/deps/git/source" \
        "$HOME/gdk/gitaly/_build/deps/libgit2/source" \
        "$HOME/gdk/gitaly/_build/cache" \
        "$HOME/gdk/gitaly/_build/deps" \
        "$HOME/gdk/gitaly/_build/intermediate" \
        "$HOME/.cache/" \
        "$HOME/gdk/gdk/gitlab" \
        /tmp/*

# Install Google Chrome version with headless support
# Download from our local S3 bucket, populated by https://gitlab.com/gitlab-org/gitlab-build-images/-/blob/master/scripts/cache-google-chrome
#
RUN echo "${CHROME_URL}" && \
    curl --silent --show-error --fail -O "${CHROME_URL}" && \
    sudo apt update && \
    sudo dpkg -i "./${CHROME_DEB}" || true && \
    sudo apt install -f -y && \
    rm -f "./${CHROME_DEB}"

WORKDIR /home/gdk/gdk/gitlab

RUN bundle install --jobs=$(nproc) --retry=3 --quiet
RUN cd qa && \
    bundle install --jobs=$(nproc) --retry=3 --quiet && \
    bundle exec rake -f tasks/webdrivers.rake webdrivers:chromedriver:update[${CHROME_DRIVER_VERSION}]

RUN git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"

COPY --chown=gdk qa/gdk/launch .

ENTRYPOINT ["./launch"]