Mupx fail deployment due to settings.json

For those who use Digital Ocean for hosting and mupx for deployment: I can not successfully implement usage of settings.json file to run on deployment. Previously it caused failure of deployment, and now, for instance, when I tried to add the package okgrow:analytics with below code, it doesn’t work and this appear on browser console: Missing analyticsSettings in Meteor.settings.public although it is there.

{
  "public": {
    "analyticsSettings": {
      "Google Analytics" : {
        "trackingId": "xxxxxxx"
      }
    }
  }
}

When running locally, one has to type meteor --settings settings.json to start the app. Is there something equivalent for the mupx? How can I configure deployment accordingly?

Needless to say, I need settings.json for storing sensitive data which shall be ignored for git as well. Perhaps just meteor command should first check if settings.json exists, and accordingly run with the settings inside (if any). Then one doesn’t need to type meteor --settings settings.json every each time starting the app…

edit: valid JSON

I believe the equivalent for mupx is the same - just use mupx deploy --settings settings.json

I have development, staging and production settings so I need to make this explicit on deployment each time.

Aha, thanks! I will try and inform with the result here.

I tried this but it did not work :confused: Console gives the same message:

Missing analyticsSettings in Meteor.settings.public

Any further suggestions?

Is your settings file valid JSON? - your example isn’t. (Count the braces)

Indeed it is. I realised only the example here I pasted is wrong. My code in project is correct, valid JSON.

So my problem persists.

I realised my problem was due to having the settings.json file in the root of the project rather than within the mupx deploy folder. :stuck_out_tongue_closed_eyes:

It was sufficient, then, to just run mupx deploy

1 Like