Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Setting application-specific environment variables


It is very common that people deploy their application in multiple environments, such as testing, staging, and production. Usually, the configuration differs between these environments to ensure that you are using the right service for the right environment. Consider an example where you want to send e-mails in your application. In the production environment, you would like to use the cloud e-mail service, such as Sendmail (accessible at https://www.sendmail.com/), but in the development environment, you would like to use an open source version of Sendmail. Environment variables provide a programming language and operating-system-agnostic solution to these kinds of problems.

Hard coding configuration values in the source code is never a good idea, as it leads to strong coupling between your code and the values, compromising the security of your app if your code falls into the wrong hands. The environment variables allow you to use the same...