{% macro load_file(filename) %}{% include filename %}{%- endmacro -%}
---
apiVersion: build.openshift.io/v1
kind: BuildConfig
metadata:
  name: easyfix
  labels:
    app: easyfix
    build: easyfix
spec:
  runPolicy: Serial
  source:
    type: Git
    git:
      uri: https://github.com/fedora-infra/fedora-gather-easyfix.git
      ref: {{ (env == 'production')|ternary('stable', 'develop') }}
    contextDir: /
  strategy:
    type: Source
    sourceStrategy:
      from:
        kind: ImageStreamTag
        # name: python:3.11
        # namespace: openshift
        # OpenShift does not have Python 3.11 (yet), use our own ImageStream
        name: python-311:latest
  output:
    to:
      kind: ImageStreamTag
      name: easyfix:latest
  triggers:
  - type: ConfigChange
  - type: ImageChange
  - type: GitHub
    github:
      # Not sure why secretReference does not work, but it doesn't.
      # secretReference:
      #   name: easyfix-github-webook
      secret: "{{ (env == 'production')|ternary(easyfix_prod_github_secret, easyfix_stg_github_secret) }}"
