I’ve seen others ask this but not sure I really understand the best solution about editing and developing a theme within Bedrock, and having it deploy smoothly.
I’ve developed a theme that is currently a standalone repo, and have added it as a dependency to my Bedrock’s composer.json file.
So it’s no surprise that whenever I make edits to the theme while in the Bedrock folder, the changes get reflected on the Bedrock repo, not the theme repo (even after adding the theme folder to the .gitignore file).
Yet, if I remove the theme as a composer dependency, and edit/push changes to the Bedrock repo, there are issues when I deploy to my staging server. Namely, the folder gets created but the existing theme files do not get overwritten/updated.
I suppose I could keep the theme development outside the Bedrock local environment, and run ‘composer update’ inside Bedrock whenever I make theme changes, but that seems a little unwieldy.
Any thoughts? Happy to show my repos as examples.
(And apologies for being like the 1000th person to ask this!)
Well it’s hard to say because it’s dependent onto your deployment process which you haven’t mentioned anything about.
But is there a reason why you want your theme as a separate repo? If the theme is only being used on that site then it should be part of the project repo.
Keeping the theme a separate repo is probably just habit to be honest, but one I should shake
Here’s just the top of my deploy.rb for space, and full code found here. Let me know what other deployment process info you/others needs so I know for future reference.
set :application, 'bedrock'
set :repo_url, 'git@github.com:tgelles/timmygelles.git'
set :branch, :master
set :deploy_to, -> { "~/public_html/#{fetch(:application)}" }
set :log_level, :debug
set :tmp_dir, "/home/timmygel/capistrano_tmp"
set :linked_files, fetch(:linked_files, []).push('.env')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')
If you removed your theme as a Composer dependency and committed it to your repo (as I see here) then there should be no issue deploying it. At that point it’s the same in any other file in the repo. If Capistrano is working at all then it should work for all files.
yeah, i slept on the question and did exactly that. thanks for your help, though! (and also having wonderful themes, stacks, etc!)