I've seen previous discussions in the forum about how to manage different environments and deployments with Xano (Such as this thread https://community.xano.com/start-a-discussion/post/best-practices-for-environments-and-deployment-DMuYtaJkTl3ernU), but I'm still not quite confident with how to approach this in my applications, and wondered if someone could perhaps share some knowledge/experiences.
Let me illustrate my scenario and how I have understood the advice I've gotten so far:
My Xano workspace primarily consists of integrations with third parties. Each integration has two or more environments, test and production at minimum. From my experience, the way to do this is to have one set of environment variables for each environment. This does not seem to be straight forward in Xano, however.
Let's say I go with an approach of using branches to manage environments: I could set up a "main" branch that developers would use as a base for developing new features. We could then have a "test"-branch that would represent our test environment. Once a feature is ready to be tested, we could merge the latest changes into the test-branch, and similarly for the prod-branch once its production ready. Only the test and prod branches would then be meant to be used from the outside. If we would store configuration in Environment variables list in Xano, we could then create a function to retrieve the correct configuration based on the branch name.
My problems with this is the following:
a) The "environment variables" list in Xano is just list of key value pairs, with no apparent easy way to extract a set of related pairs for a certain environment. Wouldn't it then just be easier to store this in a database table?
b) If I'm not careful with how I set this up, future developers could easily mess this up merging branches?
c) Only one branch can be set to "live" at a time. I'm not sure what setting a branch to live does except perhaps defaulting all requests to this branch, and enabling cron jobs on this branch. This means if I want to develop a new cron job that communicates with a third party on a certain environment, I would have to temporarily set that branch to live, which could interfere with jobs in production?
Any thoughts? How did you do it in your Xano applications?
Manage environments and deployments - revisited
Other
1 reply