This means there is a race condition going on. If OpenShift is fast enough, it will start building as soon as line 86 runs and will fail to clone because the key has not been setup yet. Indeed we have seen this happen with a new/faster machine:
Cloning "ssh://git@bitbucket.org/namoroon/core-server.git" ...
error: build error: Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Manually forcing a second build works (because now the secret has been setup).
It is necessary to create the app but tell OpenShift to wait a bit longer before trying to build (line 86). We should signal GO only after the key/secret has been configured (line 91).
We configure the app's private key (so that OpenShift can clone the project) here:
https://github.com/sglebs/ndeploy/blob/master/nd/openshift.py#L91
But the app is created earlier, here:
https://github.com/sglebs/ndeploy/blob/master/nd/openshift.py#L86
This means there is a race condition going on. If OpenShift is fast enough, it will start building as soon as line 86 runs and will fail to clone because the key has not been setup yet. Indeed we have seen this happen with a new/faster machine:
Manually forcing a second build works (because now the secret has been setup).
It is necessary to create the app but tell OpenShift to wait a bit longer before trying to build (line 86). We should signal GO only after the key/secret has been configured (line 91).