How to deploy an app to production with an actual button
blog.github.com
blog.github.com
No.
The difference is that if you're using your keyboard you're very likely not to bother doing things like implementing defensive checks, reproducible and deterministic steps, good rollbacks that you've actually tested, etc. You're using your computer, so just tweaking a setting or adding in something you forgot is easy. If you're connecting your deploy process to a button then you need to automate everything in the process, which makes the process much more robust.
...and that is the justification I used to get some of these buttons this morning.
git reset --hard HEAD^
Then redo build/post-receive hooks.
That is, what would be the next command you use? You have just done a hard reset and removed the last commit from the history. Now your remote and your local copy have diverged. You can do `--force` of course to rewrite the history on your remote but that wouldn't be acceptable in a corporate environment because many other people also have their local copies of that repository and they'll all have issues after you force your change in.
A more transparent approach would be to do `git revert HEAD` or even better `git revert <hash>` to explicitly have your change be reverted with another commit.
So while it's running the previous version, you just `git pull` again to get the latest fixes for whatever broke at a later time. No history is rewritten as it fasts forward to the latest commit. I hope that clears up how it's used. As far as I know this is a common pattern of usage for deployment scenarios.
1. Push to somewhere (maybe a bare repo, or github/bitbucket). 2. Production clone pulls from the master.
If any issues arise, you can do git reset --hard HEAD^ on the production repo to rollback any changes to an arbitrary prior version.
> However if you have other developers or SRE that have that repo checked out, they'll have problems
What do you mean by this? The production repo should only be read from by production services serving from it (webserver, database, etc). Any engineers shouldn't be making commits to it and merging upstream. It should be purely be used for deployment.
I think maybe you're assuming the production repo is also the master repo? This is not something I recommend and if you use my deploy scenario, this is not how it would be setup. The production repo should just be a clone of the master, purely pulling updates from master just like everyone else, which can be on github or another bare repo that others work from. Except the production repo would also be a read-only repo. You obviously don't SSH in, make hot patches, and commit from there. Based on this, what I suggested (git reset --hard HEAD^) and having a repo deployed on the production server is a best practice for deployment. It allows for effortless roll back to arbitrary prior states, easy post-update hooks for build steps. And should upstream ever be updated, it's one command that just re-syncs (git pull) to any of the latest fixes for whatever went wrong.
May want to catch up on some git yourself.
https://en.m.wikipedia.org/wiki/Two-man_rule
Good for not having to spend the weekend at work alone.
I believe it also flashes logs at you in (red) Morse code. It's not the most effective way to monitor a release.
More to the point did they want to be the ones to push it? :-P
They did, they’d come sit at my desk and push the button. I always thought it was weird.