We are using a GitOps model for deploying our software. Everything in dev
branch goes to the dev environment and everything in main
gets deployed to production. All good and fine except that we use Google Cloud Endpoints that rely in the host
parameter of the openapi.yaml
. There is only room for a single value so we have to remember to change it for each deployment not allowing us to do a fully automated deploy.
How do you manage the same openapi.yaml
definition when using Google Cloud Endpoints?
There is one example given in the official documentation, see if it helps your use-case.
One common solution for different environments properties management is to create different build profiles, and create different environment specific properties files like openapi_dev.yaml, openapi_qa.yaml, openapi_prod.yaml, and supply the one based on the profile(dev/qa/prod) being used. Refer here for more details.
Another way documented at GitOps-style continuous delivery with Cloud Build, where a multi branch, multi-repository approach is suggested.