---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: packager-dashboard-build
  labels:
    environment: "packager-dashboard"
spec:
  output:
    to:
      kind: ImageStreamTag
      name: packager-dashboard:latest
  source:
    type: Git
    git:
      uri: https://pagure.io/fedora-qa/oraculum
      ref: "master"
  strategy:
    type: Source
    sourceStrategy:
      from:
        kind: DockerImage
        name: registry.access.redhat.com/ubi8/python-39
  triggers:
  - type: ConfigChange
  - type: ImageChange
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: packager-dashboard-frontend-build
  labels:
    environment: "packager-dashboard"
spec:
  output:
    to:
      kind: ImageStreamTag
      name: oraculum-frontend:latest
  source:
    type: Git
    git:
      uri: 'https://pagure.io/fedora-qa/packager_dashboard.git'
{% if env == 'staging' %}
      ref: 'master'
{% else %}
      ref: 'prod'
{% endif %}
  strategy:
    type: Docker
    dockerStrategy:
      dockerfilePath: Dockerfile
      env:
      - name: "SUBDIR"
        value: "/"
      - name: "API"
        value: "https://packager-dashboard{{ env_suffix }}.fedoraproject.org/api/v1/"
      - name: "APIv2"
        value: "https://packager-dashboard{{ env_suffix }}.fedoraproject.org/api/v2/"
  triggers:
  - type: ConfigChange
  - type: ImageChange
