What I am looking to do: In order to achieve version control via git; whenever I make changes on the Wordpress site, these changes are push to a GitHub repo. I have other projects where I make changes in git, and those changes are pushed to an S3 bucket holding static site files. However, I have not found anything as of yet, that has insight to what I am trying to do with the former.

Initially, I am thinking I will need a Lambda function that watches for site file changes in the S3 bucket. If a change, trigger a separate Lambda function to push to a GitHub repository.

My question is: How do I go about doing this? Are there existing tutorials on a setup similar to what I am trying to achieve?

In my mind, the concept is pretty straight forward. But, I could use some tips to help me actually implement this.

Current setup: Amazon EC2 (wp site files), RDS (database), S3 bucket (cron job on EC2 to push site files to one bucket and media to another bucket), Content Delivery Network (CDN) for speedier retrieval of the media in S3.

rough diagram of current architecure

  • The contents of your WordPress site is mostly stored in the database. Files change for software updates, plugins, themes, and uploads. Unless you are going to be modifying WordPress itself (as opposed to writing content on your WordPress site), putting the changes into git doesn't make much sense to me. Git and databases are not compatible as far as I know. Sep 9 '19 at 15:45
  • "Git and databases are not compatible as far as I know." There are tools built on top of git to manage content in databases, see sqitch.org/about But I agree that using git in the described setup seems not aligned with the goals. Sep 9 '19 at 16:11
  • Thank you both for your input! I may be overkilling this setup anyway. By trying to put git in the mix --S3 can have version control added (though not as pretty/manageable as git); though with some extra cost. And having my database sitting on RDS like it is, I have automatic snapshots being taken already. Sep 9 '19 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.