Roots Discourse

How to add new folder to site directory

We have a 3rd party service we’ve added to our /site/web directory along side the /app and /wp directories and version controlled. This way we can call the directory like www.example.com/folder

However, everytime we deploy it breaks this due to the releases bedrock creates, etc… hopefully my understanding of this is correct.

How can we go about having this folder exist here and be accessible after each deploy?

Can you be more specific w/r/t to how it breaks? If the folder is committed to your repository, there’s no reason that it shouldn’t be there when new releases are deployed.

Yeah, so for example… the 3rd party service is idevaffiliate: https://www.idevdirect.com/
We’ve put the folder in the /web directory so that its accessible like www.example.com/idevaffiliate

We’ve setup a different database on the DO droplet to install this idev on. The install goes fine the first time around. After another deploy visiting the /idevaffiliate url directs us to the install directory again: idevaffiliate/install, however that folder doesn’t exist because it’s renamed after install.

Somehow, deploys are breaking this path.

Are you adding the idevaffiliate directory to your repository?

Yes, it’s in the repo.

This is the landing page to login to the idevaffiliate. I just dropped the db, created a db and installed this idev here again.

Now I just ran a deploy and here’s what happens when trying to access the /idevaffiliate sub-directory… is that it tries to make me install it again:

https://staging.example.com/idevaffiliate/install/

I don’t know anything about what idevaffiliate is, but my guess is that its install process hardcodes the absolute location of the deploy (which changes with new deploys) and not the symlinked location (which does not). If that’s what it’s doing, I’m not sure if there’s any way to make bedrock or trellis modify their behavior in a way that would resolve your problem.

Thanks for your help even though this may not be specific to the Roots package. Here’s the response I received the the iDevAffiliate tech support.

If you are being guided to the /install folder it means iDevAffiliate doesn’t fine a /API/database.php file so its taking you in to “new installation” mode.

I really don’t know what you’re doing to cause this. It sounds like a hosting/logistics issue of some sort. Symlinks will almost always be an issue though. You need to install into the live/final location maybe.

Symlinks will almost always be an issue though. You need to install into the live/final location maybe.

Given the deploy structure of Bedrock & Trellis, there isn’t really a “final” location; the “real” location changes on each deploy, which is kind of the point.

If this product

  1. requires a specific, un-customizable location
  2. cannot be placed in a symlinked folder
  3. has to dynamically generate its own files

then I feel like getting it to work w/ Trellis and Bedrock may be difficult. You might be able to put it in the shared directory (which persists across deploys), or write a Trellis script that moves/regenerates the necessary files on deploy, but that’s a little outside my wheelhouse.

Thanks for the response. Sorry about the delay in thanking you.

I’m going to see if I can figure out how to use the shared folder to get this operating but at first glance I’m not quite sure how to do so.

Also waiting for a response from the idev developers…

Thanks again.

This topic was automatically closed after 42 days. New replies are no longer allowed.