How can selectively run build commands per site?

Thanks for the detailed solution. I tested both of them in order to understand a bit more how to work with trellis and ansible. Both worked.

Adding the pre_build_commands_local to the wordpress_sites worked fine except that I had to change {{ project.local_path }} to an explicit directory. Would it be possible to reference a variables from the current array in that case? local_path is declared just before pre_build_commands_local. Anyhow I got it working, I am taking the opportunity to learn. :smile:

As for adding when: project.run_pre_build_commands_local, would it be possible to change the deploy task you specify without changing the file in the roles directory? Can I redefine a task or add the conditional from… my group_vars/development file?

1 Like