diff --git a/playbooks/openshift-apps/asknot.yml b/playbooks/openshift-apps/asknot.yml index 0e6cebc629..f7f86a85a4 100644 --- a/playbooks/openshift-apps/asknot.yml +++ b/playbooks/openshift-apps/asknot.yml @@ -22,7 +22,7 @@ - role: openshift/object app: asknot - file: buildconfig.yml + template: buildconfig.yml objectname: buildconfig.yml - role: openshift/start-build diff --git a/roles/openshift-apps/asknot/files/buildconfig.yml b/roles/openshift-apps/asknot/files/buildconfig.yml deleted file mode 100644 index cd696d9787..0000000000 --- a/roles/openshift-apps/asknot/files/buildconfig.yml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: BuildConfig -metadata: - name: asknot-build - labels: - environment: "asknot" -spec: - source: - git: - uri: https://github.com/fedora-infra/asknot-ng.git - ref: "os-staging" - strategy: - type: Docker - triggers: - - type: ImageChange - output: - to: - kind: ImageStreamTag - name: asknot:latest diff --git a/roles/openshift-apps/asknot/templates/buildconfig.yml b/roles/openshift-apps/asknot/templates/buildconfig.yml new file mode 100644 index 0000000000..62e881a2e2 --- /dev/null +++ b/roles/openshift-apps/asknot/templates/buildconfig.yml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: BuildConfig +metadata: + name: asknot-build + labels: + environment: "asknot" +spec: + source: + git: + uri: https://github.com/fedora-infra/asknot-ng.git +{% if env == 'staging' %} + ref: "staging" +{% else %} + ref: "production" +{% endif %} + strategy: + type: Docker + triggers: +{% if stg_asknot_github_secret is defined and env == 'staging' %} + - type: GitHub + github: + secret: "{{ stg_asknot_github_secret }}" +{% elif asknot_github_secret is defined and env == 'production' %} + - type: GitHub + github: + secret: "{{ asknot_github_secret }}" +{% endif %} + - type: ConfigChange + - type: ImageChange + output: + to: + kind: ImageStreamTag + name: asknot:latest