From 185a24c325d8b1c5b594e977d7777de6a7a88bad Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 14 Aug 2018 15:41:42 +0200 Subject: [PATCH] Add a conditional to declare secrets This permit to push the modification, then open a ticket to add the secret, and deploy fine in staging if there is no integration with github. --- roles/openshift-apps/coreos/templates/buildconfig.yml | 6 ++++++ .../openshift-apps/silverblue/templates/buildconfig.yml | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/roles/openshift-apps/coreos/templates/buildconfig.yml b/roles/openshift-apps/coreos/templates/buildconfig.yml index 8a4b69c5fe..6626314091 100644 --- a/roles/openshift-apps/coreos/templates/buildconfig.yml +++ b/roles/openshift-apps/coreos/templates/buildconfig.yml @@ -20,6 +20,12 @@ spec: kind: ImageStreamTag name: s2i-golang:latest triggers: +{% if coreos_github_secret is defined %} + - type: GitHub + github: + secret: "{{ coreos_github_secret }}" +{% endif %} + # TODO add that once it is clear on how to store the secret # - type: GitHub # github: diff --git a/roles/openshift-apps/silverblue/templates/buildconfig.yml b/roles/openshift-apps/silverblue/templates/buildconfig.yml index 3bf7ded4d8..4d71b2d35d 100644 --- a/roles/openshift-apps/silverblue/templates/buildconfig.yml +++ b/roles/openshift-apps/silverblue/templates/buildconfig.yml @@ -20,9 +20,10 @@ spec: kind: ImageStreamTag name: s2i-golang:latest triggers: -# TODO add that once it is clear on how to store the secret -# - type: GitHub -# github: -# secret: "some_coreos_github_secret" +{% if silverblue_github_secret is defined %} + - type: GitHub + github: + secret: "{{ silverblue_github_secret }}" +{% endif %} - type: ConfigChange - type: ImageChange