Property referencing is one of the most powerful features in the CloudBees CD/RO product suite. Mastering property referencing will let you extend CloudBees CD/RO to meet your organization’s deployment needs.
This use case shows how to leverage properties to create a flexible deployment model. It assumes that you are developing a CloudBees CD/RO application for a web application deployment to production. The deployment process requires that the application is properly tested in the DEV and QA environments before deploying it to the production. Each of these environments uses different database connections for certifying various aspects of the web application. The QA environment uses a database that is created specifically to test the scalability aspects of the application. The challenge is to determine how to manage the database configuration across these environments.
Start by modeling three environments under a project called Banking:
-
DEV
-
QA
-
PROD
Then create the appropriate database (DB) credentials in the Banking project for each database used with these stages. Each credential is identified by a name:
For each environment, create a property called DB_credential
and initialize it with its corresponding DB credentials name.
To leverage these properties in an application or component process step, use $[/myEnvironment/DB_CREDENTIAL]
to identify and access the DB credential information as described in the KBEC-00325 knowledge base article.
Using this credential information, you can connect CloudBees CD/RO to the appropriate database and populate the necessary test data. In this use case, myEnvironment
refers to the currently running environment. There are similar shortcuts available for other deploy objects, such as myApplication
or myEnvironmentTier
. You can extend this concept to store environment- or environment-tier specific attributes such as port numbers or URLs.