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

Re: Changing Environment in STI Builds

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 
$ vim examples/sample-app/application-template-stibuild.json
$ oc replace -f examples/sample-app/application-template-stibuild.json

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

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