content_image/836230.jpg
<img src='content_image/836230.jpg'>

## 2.3.4.2. Specifying build environment variables 

## NOTE 

Any BuildConfig  objects created as part of new-app  processing are not updated with environment variables passed with the -e|--env  or --env-file  argument. 

When generating applications from a template, source, or an image, you can use the --build-env argument to pass environment variables to the build container at run time: 

$ oc new-app openshift/ruby-23-centos7 \ 

--build-env HTTP_PROXY=http://myproxy.net:1337/ \ 

--build-env GEM_HOME=~/.gem 

The variables can also be read from a file using the --build-env-file  argument. The following is an example file called ruby.env : 

HTTP_PROXY=http://myproxy.net:1337/ GEM_HOME=~/.gem 

Read the variables from the file: 

$ oc new-app openshift/ruby-23-centos7 --build-env-file=ruby.env 

Additionally, environment variables can be given on standard input by using --build-env-file=- : 

$ cat ruby.env | oc new-app openshift/ruby-23-centos7 --build-env-file=- 

## 2.3.4.3. Specifying labels 

When generating applications from source, images, or templates, you can use the -l|--label  argument to add labels to the created objects. Labels make it easy to collectively select, configure, and delete objects associated with the application. 

$ oc new-app https://github.com/openshift/ruby-hello-world -l name=hello-world 

## 2.3.4.4. Viewing the output without creation 

To see a dry-run of running the new-app  command, you can use the -o|--output  argument with a yaml or json  value. You can then use the output to preview the objects that are created or redirect it to a file that you can edit. After you are satisfied, you can use oc create  to create the OpenShift Container Platform objects. 

To output new-app  artifacts to a file, run the following: 

$ oc new-app https://github.com/openshift/ruby-hello-world \ -o yaml > myapp.yaml 

Edit the file: 

$ vi myapp.yaml 

