[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Changing Environment in STI Builds



Thanks again. 

I just managed to create a separate BuildConfigs file from the main application-template-stibuild.json and did a 
oc replace -f bc.json
and that seemed to work. Although the builds were starting again from 1. I will try the oc edit bc option.

Thanks a lot for your help. 

On Tue, Aug 11, 2015 at 6:43 PM, Rodolfo Carvalho <rcarvalh redhat com> wrote:
On Tue, Aug 11, 2015 at 2:41 PM, Raja <rajasaur gmail com> wrote:
It seems to pick up the changes that I made to the template.json file after I cleaned up the whole setup and re-tried it. 

I think my only query now is how do I refresh the json file. If I make any changes to it i.e. add new environment variables or change them, how do I make those be used by the build process. I tried oc edit and oc process but they both did not seem to update the json file. Sorry if I missed this in the docs but couldnt find it as far as I can see.


OpenShift is not tracking the JSON file (either a local file, or accessible via HTTP, etc). After you create a template in OpenShift with that file, you can:

1) Edit the file and use `oc replace` to update the template OpenShift knows about:

$ oc create -f examples/sample-app/application-template-stibuild.json 
templates/ruby-helloworld-sample
$ vim examples/sample-app/application-template-stibuild.json
$ oc replace -f examples/sample-app/application-template-stibuild.json
templates/ruby-helloworld-sample


2) Edit the template within OpenShift (as opposed to using an external file):

$ oc edit template ruby-helloworld-sample



After doing 1 or 2, only new application using that template will pick up the changes.


If you want to change an existing application, you want to use `oc edit` to change the existing BuildConfig (rather than the template):

$ oc edit bc ruby-sample-build


(bc is short for buildconfig)


--
Rodolfo Carvalho

OpenShift Developer Experience



--
Raja
rajasaur at gmail.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]