DEV Community

Discussion on: Pushing WordPress Theme Updates With Git

Collapse
 
lewiscowles1986 profile image
Lewis Cowles

Hey Jack,

I suppose it's best to start from, how are clients approving changes if it goes from local-dev to live?

I've worked in the way you've described before, so I know the stress and pain it can cause for me, and for clients.

I wouldn't call backups or deploys an enterprise pattern as much as a recognition of value.

You could start by enabling droplet backups, learning wp-cli for exporting the database, plugin & theme installs, experimenting in VM's.

I'm not seeing lots of use-case for WordPress in Docker containers outside of testing. It was different in the initial PHP7 launch, but it is the only actively supported release now (php.net/supported-versions.php), but certainly having a repeatable Vagrant VM can be of use locally to experiment with adding caching or shared state (multi-server or caching or both).

Once that is done you could experiment with child-themes, and multi-site. That can provide a single login which lets you have mutliple sites with mostly shared features, the option to diverge in a branching pattern, and the ability to interact with and gain client approval on changes.

Small things like storing nginx configs as code in repo's can help repeat-ability and consistency.

To upload themes you can ensure the branch name is included so {branch}-{theme}.zip see git-scm.com/docs/git-archive for an example of using git tag stackoverflow.com/questions/624557... shows how to get active git branch instead.

You could maintain branches for staging or use feature branches to facilitate, run webpack or gulp before creating an archive, push that to the right place using a tool like scp (digitalocean supports scp & ssh) and wp-cli install theme from zip developer.wordpress.org/cli/comman...

There is a whole lot of room to improve. Hopefully this helps some.