{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
apiVersion: build.openshift.io/v1
items:
- apiVersion: build.openshift.io/v1
  kind: BuildConfig
  metadata:
    labels:
      build: datagrepper
    name: datagrepper
  spec:
    runPolicy: Serial
    source:
      dockerfile: |-
        FROM fedora:32
        LABEL \
          name="datagrepper" \
          vendor="Fedora Infrastructure" \
          license="MIT"
        RUN dnf -y install fedora-messaging python3 python3-fedmsg python3-gunicorn python3-pip python3-psycopg2 git
        RUN git clone https://github.com/fedora-infra/datagrepper.git /srv/datanommer && \
            cd /srv/datanommer && \
            python3 -m pip install -r requirements.txt && \
            python3 -m pip install . --no-use-pep517 && \
            mkdir -p /usr/share/datagrepper && \
            cp /srv/datanommer/apache/datagrepper.wsgi /usr/share/datagrepper/datagrepper.wsgi && \
            cp /srv/datanommer/fedmsg.d/example-datagrepper.py /etc/fedmsg.d/datagrepper.py
        env DATAGREPPER_CONFIG=/srv/datanommer/apache/datagrepper.cfg
        CMD ["gunicorn", "-b", "0.0.0.0:8080", "-w", "4", "--log-level", "DEBUG", "-t", "180", "datagrepper.app:app"]
      type: Dockerfile
    strategy:
      type: Docker
      dockerStrategy:
        noCache: false
    output:
      to:
        kind: ImageStreamTag
        name: datagrepper:latest
kind: List
metadata: {}
