Copy functions from one cluster to another
It would be great if you could copy a Realm Service or Function from one cluster to another. I find myself having to open two tabs and coping the function code then checking all settings are the same etc.
We would normally dev on a "test" cluster then copy Service functions over to "prod" cluster. Or am I missing something?
-
Andrew commented
We do the same thing. We have one project for each environment, each with its own cluster. Unfortunately, we chose difference cluster names for each.
I wrote a small JS script that would change the cluster name in the "data_sources\mongodb-atlas\config.json" file. When pushing to a different project we change the connection in the APPSERVICES CLI and then run the script to change the cluster name. Then you can push.
Also had to extend the script to change the environment name setting in the root_config,json file.
Ideally need --cluster-name and --environment options for appservices CLI
-
David commented
Have you tried to write a script with the api. Do you think it's possible to write one that could sync dev and prod ?