HACKER Q&A
📣 rbarnes01

How do you push website updates to live?


Hi everyone, I wanted to reach out to the community to see best practices for pushing updates to live sites.

I run an e-commerce site running a php shopping cart system. The way the shopping cart is structured is admittedly a bit complicated, which makes me nervous when I push live updates to the site.

Currently, I have a hosted dev site where I make changes, and when I'm ready for a release I manually change the files in the ftp. Not the best solution, especially considering a high chance of user error.

What is the standard practice for pushing updates? Git would make more sense, but implementation seems daunting. Any advice is appreciated!


  👤 smt88 Accepted Answer ✓
> Git would make more sense, but implementation seems daunting.

Do you use version control now? If not, do it immediately. Initiating a git repo is very easy. You can use a boilerplate repo if you don't understand how gitignore works[1]. You should also look into gitattributes files.

If "implementation" means "deploying from a git repo", there are a million tools to do this. It's built into GitHub and BitBucket now, but you can also use Elastic Beanstalk or CodeDeploy on AWS. Azure and GCP have similar tools.

> What is the standard practice for pushing updates?

Bare minimum is having a way to trigger a deployment from a particular commit in git.

Best practice would be a full CI/CD server. It sounds like you probably don't have unit or end-to-end tests, but if you did, the CI/CD server would run the tests on any individual commits and report errors to you.

You could have manual or automatic deployments based on the latest commit on certain branches.

There's a lot to understand and unpack here, but there are also a ton of SaaS products to make it easier.

Honestly, though, you're a lot better off just moving to Shopify...

1. https://github.com/Partyschaum/php-boilerplate


👤 davismwfl
Keep it simple, if it is only you making changes and your primary business is selling on the site and not the software then just use something like rsync or ssh/scp etc and script it. At most use something like ansible, chef or puppet.

If your primary thing is the software and you are deploying many times a week, then it can make more sense to have more sophisticated controls, but even then as one person a few scripts is usually plenty good enough.

If your primary business is the products you sell and not the software, I would be curious why you chose to build a shopping cart/e-commerce solution. There are so many good solutions out there it is usually just a distraction to build your own unless you have hit a large scale or are in just such a custom niche that nothing works for your product/service unless you write it.