Travis CI deploy stage exits before asynchronous provider rollout finishes
0 reputation · 26 Feb 2023, 11:19 UTC
0 reputation · 26 Feb 2023, 11:19 UTC
When using Travis CI's deploy stage to drive a zero‑downtime migration, the build exits as soon as the deploy command returns, even if the target platform (for example Kubernetes) is still performing a rolling update. This behavior is documented: Travis CI does not wait for asynchronous provider operations to complete.
The 50‑minute job timeout and 10,000‑line log limit further constrain long‑running rollouts, making it unclear how to reliably confirm that the migration has finished before the job ends.
What patterns reliably make the deploy stage wait for a Kubernetes rolling update to finish? How can the 50‑minute job timeout be accommodated for large rollouts? Are there recommended async trigger alternatives such as Argo CD that integrate with Travis CI?
The deploy stage exits immediately upon the return of the deployment command because Travis CI does not inherently wait for asynchronous provider operations, such as a Kubernetes rolling update, to complete. This is a documented behavior of the CI runner execution model, not a flaw in the deployment command itself.
The reliable pattern is to replace a simple deployment command with a script that actively polls the target platform's API until the desired state is achieved.
To accommodate rollouts exceeding the default 50-minute limit, the Travis CI job timeout must be explicitly increased in the configuration file, provided the Travis CI environment supports this override for the specific job.
For complex, long-running zero-downtime migrations, decoupling the deployment lifecycle from the CI pipeline is recommended. Tools like Argo CD are designed to manage the state of the cluster independently, triggering from Travis CI only upon successful artifact delivery, not deployment completion.
To provide the most precise advice, confirm if the deployment script currently contains any form of status polling or if it relies solely on the immediate success code of the initial deployment command.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.