From 560760d7ac5892f20510433a1cff64168664c1f2 Mon Sep 17 00:00:00 2001 From: Alper Date: Wed, 15 Jan 2025 12:55:21 +0100 Subject: [PATCH] CI Deployment and stakeholder deployment for Broker is aligned --- code/broker/start.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/broker/start.js b/code/broker/start.js index e2532a6..52bb0bf 100644 --- a/code/broker/start.js +++ b/code/broker/start.js @@ -3,11 +3,14 @@ import Broker from '@sap/sbf'; -// If this is a CI CD deployment we get broker credentials from env and hardcode the catalog. - if (process.env.VCAP_APPLICATION && process.env.NODE_ENV === "production" && process.env.cicd !== true) { +// If we are running as a CF deployment we get broker credentials and catalog from environment variables + if (process.env.VCAP_APPLICATION && process.env.NODE_ENV === "production") { new Broker().start(); } else { - // In production Kyma scenarios, local testing and CI CD, BROKER_USER and BROKER_PASSWORD are passed in env variables + // In production Kyma scenarios, local testing BROKER_USER and BROKER_PASSWORD are passed in env variables + if(process.env.SBF_BROKER_CREDENTIALS) delete process.env.SBF_BROKER_CREDENTIALS + if(process.env.SBF_BROKER_CREDENTIALS_HASH) delete process.env.SBF_BROKER_CREDENTIALS_HASH + let brokerConfig = { brokerCredentials: { [process.env["BROKER_USER"]]: process.env["BROKER_PASSWORD"] } } new Broker(brokerConfig).start() } \ No newline at end of file