I was on recently on a client project and we needed to deploy our application code using tarballs and AWS S3 and EC2.
Problem: I need a history of tarballs that have been generated incase we need to rollback. While we create backups before deploying any new code and we use Git so we can generate a new tarball for any point in time I wanted something even easier.
Solution: A shell script that is aliased to run from the terminal.
1 |
|
Before running this script:
- Create a folder on your file system with write rights
- Create an alias to the above script
Using this script I’m able to quickly generate a new tarball along with a timestamped copy saved to the file system.