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

Re: Determine when a deployment finishes programmatically



On Fri, Jul 8, 2016 at 9:19 PM, Alex Wauck <alexwauck exosite com> wrote:
On Fri, Jul 8, 2016 at 12:25 PM, Rodolfo Carvalho <rcarvalh redhat com> wrote:
@Alex, when using `oc get --watch`, probably you want to combine that with an alternative output format, like json, jsonpath or template.
Then act upon every new output.

That will probably be OK.  I see that using a different output format tells me how many replicas I should expect, so I can just wait for status.replicas to match spec.replicas.
 
Or maybe I just interpreted you wrong and all you want is some programmatic way the current deployment state? (complete, failed, running)
And not *wait for it to finish*?

Well, if I can get the current deployment state, I can wait for it to finish by polling until the state is "Complete".  This is intended for use in automated tests, since we don't really want to start testing until the new version is fully deployed in our staging environment.




In that case, use and abuse the knowledge from OpenShift Origin tests.

For instance, this is a Bash helper to wait for a registry to be deployed:

https://github.com/openshift/origin/blob/4f6e3a896831f2ec34b9daf0ced341be382daf21/hack/util.sh#L669-L674

You could do the same for any other deployment config.




Rodolfo Carvalho | OpenShift

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