Closed plashenkov closed 4 years ago
Using force: yes will cause all sorts of other problems and undesired side effects if something exists there and ansistrano deletes it with a bad configuration
As you point out, you can for instance easily create the var folder with a .gitkeep file in your repo or as part of your before / after setup hooks. As for .env.local files they should be provided with other ways (either provision it or download it from somewhere as part of your provisioning / deployment) or create a symlink as you say
Closing as this is not an ansistrano issue but something specific to Symfony that can be solved easily without causing undesired side effects in other setups
Thank you, you are right. Already configured everything and all is great, thank you.
Hi!
I have been trying to make a deployment of Symfony app, and I need to add these shared items:
I get the following error message on deploy:
Yes, I have already viewed the similar issue: https://github.com/ansistrano/deploy/issues/275 and have seen the suggestion to create a hook to ensure the
var
folder exists insideshared
.But the problem is not the
var
folder doesn't exist insideshared
(I can clearly see thatvar/log
andvar/sessions
folders are inside shared). The problem is thevar
folder doesn't exist inside{{ ansistrano_release_path.stdout }}
.Okay... I've created a task file (ansistrano_before_symlink_shared_tasks_file) which creates the
var
folder inside{{ ansistrano_release_path.stdout }}
manually. And now it works!But now files:
.env.local
and.env.local.php
. Especially the last one (.env.local.php
): it shouldn't exist — it will be generated later, but now I need just a softlink to it even if it currently doesn't exist. I do not see a clear way to beautifully workaround this.And the main question: why not just use
force: yes
here: https://github.com/ansistrano/deploy/blob/master/tasks/symlink-shared.yml#L16? It looks like it would solve all the problems.