Skip to content

Commit

Permalink
CI Deployment and stakeholder deployment for Broker is aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
alperdedeoglu committed Jan 15, 2025
1 parent f3d407b commit 560760d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions code/broker/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit 560760d

Please sign in to comment.