apiVersion: v1
kind: BuildConfig
metadata:
  name: websites-build
  labels:
    environment: "websites"
spec:
  source:
    git:
      uri: https://pagure.io/fedora-web/websites.git
{% if env == 'staging' %}
      ref: "staging"
{% else %}
      ref: "production"
{% endif %}
  strategy:
    type: Docker
  triggers:
  - type: ConfigChange
  - type: ImageChange
{% if stg_websites_deploy_secret is defined and env == 'staging' %}
  - type: Generic
    generic:
      secret: "{{ stg_websites_deploy_secret }}"
{% elif websites_deploy_secret is defined and env == 'production' %}
  - type: Generic
    generic:
      secret: "{{ websites_deploy_secret }}"
{% endif %}
  output:
    to:
      kind: ImageStreamTag
      name: websites:latest
