I’ve set up Trellis/Bedrock/Sage and I have everything working smoothly with local and staging environments, including building theme assets during deploy and pushing to the server.
I’d like to be able to do this with multiple versions of the sage theme. I thought about doing this by overriding the build-before.yml on a site-specific basis. This is my first time working with Ansible so I’m somewhat blindly following the advice of the community. My current attempt at overriding build-before.yml isn’t working. I’d like to avoid having to set this action on every site and only override when needed. Is what I’m trying to do possible?
website:
site_hosts:
- canonical: website.example.com
local_path: ../www/website # path targeting local Bedrock site directory (relative to Ansible root)
repo: git@bitbucket.org:snazzycreative/website.git # replace with your Git repo URL
branch: master
multisite:
enabled: false
ssl:
enabled: true
provider: letsencrypt
cache:
enabled: false
deploy_build_before:
- "{{ playbook_dir }}/deploy-hooks/build-before-sage8.yml"
I finally got around to figuring this out. I now have a default build-before.yml and can override said default by adding a new variable to the wordpress_site.
Being new to Ansible, I didn’t know how to access the variable.