If I have a mixed deployment mechanism of Docker-Compose plus additional commands (i.e. helm command, kubectl commands, etc.).
Based on the Okteto Manifest documentation here, the deployment process of my setup below always performs the deploy.commands first, and then deploys the Docker-Compose file second, no matter what order I put them under the deploy section:
There are two approaches that could help in this scenario:
1. Turn the deploy.compose into a custom command under deploy.commands.
For the manifest setup shown above, you can turn the deploy.compose into a command with the --wait flag. Make sure the command is specified first before the helm upgrade command, as shown below:
2. Add the docker-compose service as a dependency
This approach requires a bit more effort, and the creation of an additional okteto manifest in the same repository. You can follow these steps to set it up:
Create an additional okteto manifest in the same repository, compose-okteto.yml, pointing to the docker compose on the deploy.compose configuration as shown below:
deploy:
compose: docker-compose.yml
On your original okteto manifest, okteto.yml, refer to this docker-compose service/s as a dependency pointing to the compose-okteto.yml file and remove its reference under the deploy section, as shown below: