Roots Discourse

Nested current folders on Trellis deploys

#1

Hi there!

I’m having an issue deploying Trellis either to Kinsta and to a Digital Ocean droplet. They are different projects so I think the problem is Trellis related. If it’s not, let me know.

I’m going to focus on the Digital Ocean project. The website is deployed great on /srv/www/domain.com/releases/ and the current symlink is working great after deploy. The main problem is that if I enter the release folder I find a folder named current. Inside that folder is the entire project aswell as another current folder, and another one inside… and the rabbit hole never ends…

For instance, in my last deploy on Kinsta I have 6 folders named current with all the files from git in it…

~/public/current/current/current/current/current/current/current

The question is, how can I prevent those folders to be created? On DO droplets I have enough space and I really don’t care, but Kinsta space is limited and if I have multiple releases the space used is extremely large…

I know I can limit the releases created but the problem of nested current folders is not solved…

Can you help me? Does this happen to you all or am I the only one?

Thank you very much in advance <3

0 Likes

Composer install with no scripts doesn't work
#2

Nested current folders should not be happening — this sounds like a bug (never heard of this before) or configuration issue that is causing problems. Have you compared your deploy role to what’s included by default in Trellis?

There’s also deploy_keep_releases to change the number of how many releases to keep.

It’d be helpful to see what changes you’ve made to Trellis for your deployments to Kinsta just to confirm it all looks good

0 Likes

#3

Let me check the default role in Trellis to see what I’ve changed. I’ll come back then…

0 Likes

#4

Ok, so I’ve uploaded to Gist the deploy role files that I’ve changed. I don’t think these changes matter at all as I’ve tested changing the files to default with same results when I deploy. Changes are marked as SM!

Note that when I started the projects this was the last commit to the trellis repo: https://github.com/roots/trellis/tree/e661df1529d6d273d42b363ea055712f77279d36

So my trellis are somewhere between 1.0.0.rc2 and 1.0.0

Do you think I should update trellis to 1.0.0? or maybe I should update to last version?
Don’t know how to do it though, any docs guiding how to update?

0 Likes

#5

Ok, so I’ve found what’s going on. The problem comes up when I comment out line 16 on file https://gist.github.com/cfaria/83b06391f5ea1a632fdaf656f0a3634a#file-main-yml

If I comment it out then, somehow, trellis thinks that the project_copy_folders variable is not defined, so in trellis/roles/deploy/tasks/build.yml it uses it and copies the current folder over and over (I think that’s what it does…)

If I comment out the line 16 and declare project_copy_folders as an empty array then everything works as expected. Vendor folder is genereated everytime a deploy is taken and my Koodimmonni language packages are copied to the right folder.

So, for future reference: If you have to comment out an item of a yaml variable and that variable should be an empty array, declare it empty explicitly with [].

project_copy_folders: []
# - vendor # Need to generate vendor everytime I deploy. Koodimonni composer-dropin-installer

Thank you very much @benword for guiding me in the right direction ;D

1 Like