While trying Ghost I found myself in the need of updating the code to keep it up to date with the latest version available on github, and since both getting the updates and the deplyoment to Azure Web Sites is done via git I wrote a small batch file that automates the process.
#! /bin/bash echo Pulling from Azure git pull azure master echo Pulling updates from origin git pull origin echo Compiling assets grunt init grunt prod echo Committing to local repository git commit -a -m "Applying changes from origin" echo Pushing to Azure git push azure master
A little explanation of what the script does:
- It pulls from Azure in case the site has been edited or updated already
- It pulls from the master of Ghost to get the latest changes
- It commits to the local repository all the changes (including all the generated files)
- A finally pushes to git repository used by the Azure Web Site