apiVersion: v1
items:
- apiVersion: v1
  kind: BuildConfig
  metadata:
    labels:
      build: bodhi-web
    name: bodhi-web
  spec:
    runPolicy: Serial
    source:
      dockerfile: |-
        FROM fedora:29
        LABEL \
          name="bodhi-web" \
          vendor="Fedora Infrastructure" \
          license="MIT"
        RUN curl -o /etc/yum.repos.d/infra-tags.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags.repo
{% if env == "staging" %}
        RUN curl -o /etc/yum.repos.d/infra-tags-stg.repo https://infrastructure.fedoraproject.org/cgit/ansible.git/plain/files/common/fedora-infra-tags-stg.repo
{% endif %}
        # While dnf has a --nodocs, it doesen't have a --docs...
        RUN sed -i '/nodocs/d' /etc/dnf/dnf.conf
        RUN dnf install -y bodhi-server-{{bodhi_version}} bodhi-docs-{{bodhi_version}}
        # Put the fedmsg config in place
        RUN rm -f /etc/fedmsg.d/bodhi.py && \
        # Let's name it starting with zz so it sorts last.
            ln -sf /etc/bodhi-fedmsg.d/bodhi-openshift-web.py /etc/fedmsg.d/zzbodhi.py && \
        # Put the fedmsg cert and key in place
            mkdir -p /etc/pki/fedmsg/ && \
            ln -sf /etc/pki/fedmsg/key/fedmsg-bodhi.key /etc/pki/fedmsg/bodhi.key && \
            ln -sf /etc/pki/fedmsg/crt/fedmsg-bodhi.crt /etc/pki/fedmsg/bodhi.crt && \
        # Set up krb5
            rm -f /etc/krb5.conf && \
            ln -sf /etc/bodhi/krb5.conf /etc/krb5.conf && \
            ln -sf /etc/keytabs/koji-keytab /etc/krb5.bodhi_bodhi{{ env_suffix }}.fedoraproject.org.keytab
        EXPOSE 8080
        ENV USER=openshift
        ENTRYPOINT bash /etc/bodhi/start.sh
      type: Dockerfile
    strategy:
      type: Docker
      dockerStrategy:
        noCache: false
    output:
      to:
        kind: ImageStreamTag
        name: bodhi-web:latest
kind: List
metadata: {}
