question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

storagePath setting by environment

See original GitHub issue

Is there a way to configure the storagePath per environment? I mean, I know there are lots of ways, but was wondering which is considered a good way to do it.

In my dev environment I use:

  storagePath: Meteor.absolutePath + '/../data/attachments',

so my ‘data’ directory is one level ‘above’ my meteor project directory

For example, in dev I have:

[my app dir]/data -> file storage for various files collections [my app dir]/App -> meteor app (public, imports, etc)

When I deploy to my staging env,(or production for that matter) the build directories are a little ‘deeper’, so the relative path for my storage ends up ‘lower’ in my build tree. I’d like it to be consistent across environments.

Example of what I have now: [my app dir]/bundle (where I install the built program) [my app dir]/bundle/programs/server (what Meteor.absolutePath points to) [my app dir]/bundle/programs/data (where my file collections data ends up) [my app dir]/bundle/programs [my app dir]/repo (for pulling code and building)

I would like to still have [my app dir]/data in my staging and prod environments too if possible.

Thanks in advance for any advice.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FredHasselotcommented, Aug 6, 2020

Or: … storagePath: Meteor.isDevelopment ? ${Meteor. absolutePath}/aDevPath : ${Meteor. absolutePath}/aProdPath

1reaction
meecectcommented, Jan 27, 2020

No need to open this back up, I’m just commenting in case anyone stumbles across this. Apologies if I misunderstood your suggestion, but I was already using the meteor-root package. The issue is that the the output from absolutePath and rootPath are quite different between meteor in development mode and meteor in production mode.

I was able to fix my particular issue however by doing this:

var filesPath; if(Meteor.isDevelopment) { filesPath = Meteor.absolutePath + ‘/…/data/files’; } else { filesPath = Meteor.absolutePath + ‘/…/…/…/…/files/meteor/files’; }

and then:

export const Files = new FilesCollection({ //debug: true, debug: false, collectionName: ‘Files’, allowClientCode: false, // Disallow remove files from Client storagePath: filesPath, …

That way, in Production mode, my files location is outside the bundle directory that is built for production.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to change storage path in Laravel5.1 on different ...
I set a config in .env file on prod environment. STORAGE_PATH=/dev/shm/runtime. and write the following codes in bootstrap/app.php.
Read more >
Environment | Android Developers
Provides access to environment variables. ... getExternalStorageState(); if (Environment. ... getExternalStoragePublicDirectory( Environment.
Read more >
Environment variables support in configuration file #1681
Ability to specify environment variable link in path options (storage, plugins etc.). Will be glad to see any variable format (%var%, ...
Read more >
Settings storage path - ADMX Help
Settings storage path. This policy setting configures where the settings package files that contain user settings are stored.
Read more >
conan.conf — conan 1.12.3 documentation
The storage.path variable define the path where all the packages will be stored. On Windows: ... If you want to change the default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found