Simple deploy script for rails projects
A bash script that applies a zipped deploy to a Rails project.
To use:
- Rename deploy_script.cfg.example to deploy_script.cfg and modify as appropriate.
- Save files in /home/username/bin.
- Create a directory named deploy (or whatver value given to DEPLOYFOLDER) in /home/username.
- Rename and modify or delete deploy_script_symlinks.sh.example.
- Save a zip file to be deployed in deploy directory.
- Run deploy_script.
Steps:
- Extract deploy archive to TEMPFOLDER
- Archive live site to BACKUPFOLDER
- Move deploy archive to ARCHIVEFOLDER
- Remove certain files (e.g. database.yml) from TEMPFOLDER
- Copy content of TEMPFOLDER to LIVEFOLDER
- Recreate symlinks if they were lost by sourcing deploy_script_symlinks.sh
- Clear TEMPFOLDER
- Run rake tasks (e.g. to minify javascript)
- Restart Phusion Passenger