The Gatekeeper, or a project gating system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

89 lines
3.3 KiB

  1. # Copyright (c) 2019 Red Hat, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
  12. # implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. FROM docker.io/opendevorg/python-builder:3.8 as builder
  16. ENV DEBIAN_FRONTEND=noninteractive
  17. # Optional location of Zuul API endpoint.
  18. ARG REACT_APP_ZUUL_API
  19. # Optional flag to enable React Service Worker. (set to true to enable)
  20. ARG REACT_APP_ENABLE_SERVICE_WORKER
  21. # Kubectl/Openshift version/sha
  22. ARG OPENSHIFT_URL=https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz
  23. ARG OPENSHIFT_SHA=4b0f07428ba854174c58d2e38287e5402964c9a9355f6c359d1242efd0990da3
  24. COPY . /tmp/src
  25. RUN /tmp/src/tools/install-js-tools.sh
  26. # Explicitly run the Javascript build
  27. RUN cd /tmp/src \
  28. && mkdir -p zuul/web/static \
  29. && ln -sfn ../zuul/web/static web/build \
  30. && cd /tmp/src/web \
  31. && yarn install -d \
  32. && yarn build
  33. RUN assemble
  34. # The wheel install method doesn't run the setup hooks as the source based
  35. # installations do so we have to call zuul-manage-ansible here. Remove
  36. # /root/.local/share/virtualenv after because it adds wheels into /root
  37. # that we don't need after the install step so are a waste of space.
  38. RUN /output/install-from-bindep && zuul-manage-ansible && rm -rf /root/.local/share/virtualenv
  39. RUN mkdir /tmp/openshift-install \
  40. && curl -L $OPENSHIFT_URL -o /tmp/openshift-install/openshift-client.tgz \
  41. && cd /tmp/openshift-install/ \
  42. && echo $OPENSHIFT_SHA /tmp/openshift-install/openshift-client.tgz | sha256sum --check \
  43. && tar xvfz openshift-client.tgz --strip-components=1 -C /tmp/openshift-install
  44. FROM docker.io/opendevorg/python-base:3.8 as zuul
  45. ENV DEBIAN_FRONTEND=noninteractive
  46. COPY --from=builder /output/ /output
  47. RUN /output/install-from-bindep zuul_base \
  48. && rm -rf /output
  49. RUN useradd -u 10001 -m -d /var/lib/zuul -c "Zuul Daemon" zuul
  50. VOLUME /var/lib/zuul
  51. CMD ["/usr/local/bin/zuul"]
  52. FROM zuul as zuul-executor
  53. ENV DEBIAN_FRONTEND=noninteractive
  54. COPY --from=builder /usr/local/lib/zuul/ /usr/local/lib/zuul
  55. COPY --from=builder /tmp/openshift-install/kubectl /usr/local/bin/kubectl
  56. COPY --from=builder /tmp/openshift-install/oc /usr/local/bin/oc
  57. # https://podman.io/getting-started/installation.html
  58. COPY tools/4D64390375060AA4.asc /etc/apt/trusted.gpg.d/kubic.asc
  59. RUN echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
  60. && apt-get update \
  61. && apt-get install -y \
  62. skopeo \
  63. && apt-get clean \
  64. && rm -rf /var/lib/apt/lists/*
  65. CMD ["/usr/local/bin/zuul-executor", "-f"]
  66. FROM zuul as zuul-fingergw
  67. CMD ["/usr/local/bin/zuul-fingergw", "-f"]
  68. FROM zuul as zuul-merger
  69. CMD ["/usr/local/bin/zuul-merger", "-f"]
  70. FROM zuul as zuul-scheduler
  71. CMD ["/usr/local/bin/zuul-scheduler", "-f"]
  72. FROM zuul as zuul-web
  73. CMD ["/usr/local/bin/zuul-web", "-f"]